You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Datepicker works fine on chrome and edge but on Safari it shows error says: "options.event" must only contains valid Javascript Dates object, even though date are js date objects, please find JS code for your reference :
`<script>
$(document).ready(function (){
$.ajax({
url:"{% url 'calendar' %}",
success: function (dates) {
dates = dates['dates'];
selector = document.getElementById("cal_img");
var year;
var month;
var day;
var year_cal;
var month_cal;
var day_cal;
var events_list = [];
var date_lookup;
if (dates.length < 1){
events_list = [new Date(0000, 00, 00)];
}
else {
for (let i = 0; i < dates.length; i++){
dates[i] = dates[i].replace(/-/g,",");
events_list[i] = new Date(dates[i]);
}
}
const event = datepicker(selector, { position: 'br',
onSelect: (date) => {
year_cal = date.dateSelected.getFullYear();
month_cal = date.dateSelected.getMonth();
day_cal = date.dateSelected.getDate();
date_lookup = year_cal.toString().concat(",").concat((month_cal + 1).toString().concat(",").concat(day_cal.toString()));
for (let i = 0; i < dates.length; i++){
year = new Date(dates[i]).getFullYear();
month = new Date(dates[i]).getMonth();
day = new Date(dates[i]).getDate();
if ((year == year_cal) && (month == month_cal) && (day == day_cal)){
window.location.href = "{% url 'calendar_loads_list' date_lookup=12345 %}".replace(/12345/,date_lookup.toString());
}
}
},
events:events_list
})
}
})
})
</script>`
The text was updated successfully, but these errors were encountered:
Datepicker works fine on chrome and edge but on Safari it shows error says:
"options.event" must only contains valid Javascript Dates object, even though date are js date objects, please find JS code for your reference :
`<script>
</script>`
The text was updated successfully, but these errors were encountered: