brospars / simple-calendar

Simple calendar jquery plugin
https://brospars.github.io/simple-calendar
MIT License
49 stars 38 forks source link

Events Are Not Visible In Mac/iPhone (Safari) #48

Closed zohaibalimemonx closed 2 years ago

zohaibalimemonx commented 2 years ago

The plugin is perfectly working on ( Chrome / Opera / Firefox ) - But when I open it on Safari the calender is perfectly visible but inside it the events and notable event dates are not visible.

jQuery(document).on('click', '#showEventsTab', function(e){ e.preventDefault();

var event_calender = '<div class="events-calender-wrapper"><div id="eventCalender"></div></div>';

jQuery('.events-intro-title > a').removeClass('tab-active');
jQuery(this).addClass('tab-active');
jQuery('.custom-paging-row').hide();
jQuery('#signupEventContent').html(event_calender);
var calContainer = jQuery(document).find('#eventCalender').simpleCalendar();
let CalenderInstance = calContainer.data('plugin_simpleCalendar');

jQuery.each(cs_object.event_object, function(index, val) {
    var newEvent = {
        startDate: new Date(val.ev_date).toISOString(),
        endDate: new Date(val.ev_date).toISOString(),
        summary: '<a href="'+val.ev_link+'">'+val.ev_title+'</a>'
    }
    CalenderInstance.addEvent(newEvent);
});

});

brospars commented 2 years ago

Thanks for reporting this bug. I'll look into it.

zohaibalimemonx commented 2 years ago

Have You Checked This?

brospars commented 2 years ago

I cannot reproduce it on latest MacOS Safari. Could you share your OS and Browser versions ? Or maybe it's your val.ev_date that is not parsed correctly on Safari ?

zohaibalimemonx commented 2 years ago

Thank You, Bro - This Was The Actual Issue :) https://stackoverflow.com/questions/54726314/safari-returns-incorrect-value-for-date-toisostring

Just Changed This Line $events_data_all[$data_counter]['ev_date'] = date_format($date_d, "Y/m/d H:i:s"); From $events_data_all[$data_counter]['ev_date'] = date_format($date_d, "Y m d H:i:s");

zohaibalimemonx commented 2 years ago

Plugin is working fine :)