File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -101,11 +101,11 @@ function displayNotification(message) {
101101 } ) ;
102102}
103103
104- function isDateInPast ( dateString ) {
105- const date = new Date ( dateString ) ;
106- const today = new Date ( ) ;
107- today . setHours ( 0 , 0 , 0 , 0 ) ;
108- return date < today ;
104+ function isDateInPast ( dateString , timeString ) {
105+ const combineDateTime = ` ${ dateString } T ${ timeString } :00` ;
106+ const setDate = new Date ( combineDateTime ) . getTime ( ) ;
107+ const today = Date . now ( ) ;
108+ return setDate < today ;
109109}
110110
111111function initializeFlatpickr ( obj ) {
@@ -233,7 +233,7 @@ $('#multipleOfferingSave').on('click', function() {
233233
234234 // Add past date validation
235235 datePickerInputs . each ( function ( index , element ) {
236- if ( ! allowPastStart && isDateInPast ( $ ( element ) . val ( ) ) ) {
236+ if ( ! allowPastStart && isDateInPast ( $ ( element ) . val ( ) , startTimeInputs [ index ] . value . trim ( ) ) ) {
237237 $ ( element ) . addClass ( 'border-red' ) ;
238238 hasInvalidDates = true ;
239239 } else {
You can’t perform that action at this time.
0 commit comments