@@ -405,8 +405,7 @@ function loadOfferingsToModal() {
405405
406406function loadRepeatingOfferingToModal ( offering ) {
407407 var seriesTable = $ ( "#generatedEventsTable" ) ;
408- var eventDate = new Date ( offering . date || offering . eventDate ) . toLocaleDateString ( ) ;
409-
408+ var eventDate = formatDate ( offering . date || offering . eventDate ) ;
410409
411410 seriesTable . append (
412411 "<tr class='eventOffering'>" +
@@ -686,6 +685,9 @@ $("#cancelEvent").on('click', function (event) {
686685 if ( $ ( this ) . is ( ':checked' ) ) {
687686 $ ( "#repeatingEventsNamePicker" ) . val ( $ ( "#inputEventName" ) . val ( ) ) ;
688687 $ ( "#repeatingEventsLocationPicker" ) . val ( $ ( "#inputEventLocation-main" ) . val ( ) ) ;
688+ $ ( "#repeatingEventsStartDate" ) . val ( $ ( "#startDatePicker-mainOnly" ) . val ( ) ) ;
689+ $ ( "#repeatingEventsStartTime" ) . val ( $ ( "#startTime-main" ) . val ( ) ) ;
690+ $ ( "#repeatingEventsEndTime" ) . val ( $ ( "#endTime-main" ) . val ( ) ) ;
689691 $ ( '.addMultipleOfferingEvent' ) . hide ( ) ;
690692 $ ( "#repeatingEventsDiv" ) . removeClass ( 'd-none' ) ;
691693 $ ( "#multipleOfferingSlots" ) . children ( ) . remove ( ) ;
@@ -748,10 +750,14 @@ $("#cancelEvent").on('click', function (event) {
748750 /*cloning the div with ID multipleOfferingEvent and cloning, changing the ID of each clone going up by 1. This also changes
749751 the ID of the deleteMultipleOffering so that when the trash icon is clicked, that specific row will be deleted*/
750752 $ ( ".addMultipleOfferingEvent" ) . click ( function ( ) {
751- // Get the current value from the main location input
753+ // Get the current value from the main location input and the date input
752754 let mainLocation = $ ( "#inputEventLocation-main" ) . val ( ) ;
753- createOfferingModalRow ( { eventLocation : mainLocation } ) ;
754- } ) ;
755+ let existingRows = $ ( "#multipleOfferingSlots .eventOffering" ) . length ;
756+ let mainDate = existingRows === 0 ? $ ( "#startDatePicker-mainOnly" ) . val ( ) : null ;
757+ let mainTime = $ ( "#startTime-main" ) . val ( ) ;
758+ let endTime = $ ( "#endTime-main" ) . val ( ) ;
759+ createOfferingModalRow ( { eventLocation : mainLocation , eventDate : mainDate , startTime : mainTime , endTime : endTime } ) ;
760+ } ) ;
755761
756762 var minDate = new Date ( '10/25/1999' )
757763 $ ( "#startDatePicker-main" ) . datepicker ( "option" , "minDate" , minDate )
@@ -877,9 +883,4 @@ $("#cancelEvent").on('click', function (event) {
877883 } ) ;
878884
879885 setCharacterLimit ( $ ( "#inputCharacters" ) , "#remainingCharacters" ) ;
880- } ) ;
881-
882-
883-
884-
885-
886+ } ) ;
0 commit comments