I want the user to be able to select a date when they want to schedule an appointment, but when the user selects a date, I want the end-date to be ==
OR ===
to the start-date if the user only selects a particular date. However, when that user selects multiple dates on the calendar, I want the end-date to be different to the start-date.
Below, I ran an if/else
statement to compare the dates selected. I was expecting to get a return of the selected start-date the same as the end-date, but it returned me the outcome of the else
statement.
select: function (start, end, allDay) {
endtime = $.fullCalendar.formatDate(end, 'MMMM DD, YYYY');
starttime = $.fullCalendar.formatDate(start, 'MMMM DD, YYYY');
var when = starttime;
var to = endtime;
$('#createEventModal #apptStartTime').val(start);
$('#createEventModal #apptEndTime').val(end);
$('#createEventModal #apptAllDay').val(allDay);
$('#createEventModal #when').text(when);
if (Date.mywhen == Date.myto) {
$('#createEventModal #to').text(mywhen);
} else {
$('#createEventModal #to').text(myto);
}
$('#createEventModal').show();