@@ -77,7 +77,7 @@ body.on('click', '.btn-submit-appointment', function () {
77
77
const selectedSlot = $ ( '.djangoAppt_appointment-slot.selected' ) . text ( ) ;
78
78
const selectedDate = $ ( '.djangoAppt_date_chosen' ) . text ( ) ;
79
79
if ( ! selectedSlot || ! selectedDate ) {
80
- alert ( 'Please select a date and time' ) ;
80
+ alert ( selectDateAndTimeAlertTxt ) ;
81
81
return ;
82
82
}
83
83
if ( selectedSlot && selectedDate ) {
@@ -102,7 +102,7 @@ body.on('click', '.btn-submit-appointment', function () {
102
102
} else {
103
103
const warningContainer = $ ( '.warning-message' ) ;
104
104
if ( warningContainer . find ( 'submit-warning' ) === 0 ) {
105
- warningContainer . append ( '<p class="submit-warning">Please select a time slot before submitting the appointment request. </p>' ) ;
105
+ warningContainer . append ( '<p class="submit-warning">' + selectTimeSlotWarningTxt + ' </p>') ;
106
106
}
107
107
}
108
108
} ) ;
@@ -194,7 +194,7 @@ function getAvailableSlots(selectedDate, staffId = null) {
194
194
nextAvailableDateSelector . remove ( ) ;
195
195
196
196
// Correctly check if staffId is 'none', null, or undefined and exit the function if true
197
- // Check if staffId is 'none', null, or undefined and display an error message
197
+ // Check if ' staffId' is 'none', null, or undefined and display an error message
198
198
if ( staffId === 'none' || staffId === null || staffId === undefined ) {
199
199
console . log ( 'No staff ID provided, displaying error message.' ) ;
200
200
const errorMessage = $ ( '<p class="djangoAppt_no-availability-text">' + noStaffMemberSelectedTxt + '</p>' ) ;
@@ -234,7 +234,7 @@ function getAvailableSlots(selectedDate, staffId = null) {
234
234
235
235
if ( selectedD < today ) {
236
236
// Show an error message
237
- errorMessageContainer . append ( '<p class="djangoAppt_no-availability-text">Date is in the past. </p>' ) ;
237
+ errorMessageContainer . append ( '<p class="djangoAppt_no-availability-text">' + dateInPastErrorTxt + ' </p>') ;
238
238
if ( slotContainer . find ( '.djangoAppt_btn-request-next-slot' ) . length === 0 ) {
239
239
slotContainer . append ( `<button class="btn btn-danger djangoAppt_btn-request-next-slot" data-service-id="${ serviceId } ">` + requestNonAvailableSlotBtnTxt + `</button>` ) ;
240
240
}
0 commit comments