Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong time displaying in calendar widget #2035

Closed
kevindherman opened this issue May 9, 2022 · 8 comments
Closed

Wrong time displaying in calendar widget #2035

kevindherman opened this issue May 9, 2022 · 8 comments
Assignees
Labels

Comments

@kevindherman
Copy link

Source
Santa Ana: https://www.santa-ana.org/library-calendar/

Describe the bug
The calendar widget displays the publish time rather than the event time in the calendar display. This seems isolated to Santa Ana which makes me believe it's a WP-Rocket setting.

View https://www.santa-ana.org/library-calendar/ and you'll see event times per event. If you click on one you'll notice a different time is displayed.
https://www.santa-ana.org/event/wilshire-square-neighborhood-meeting-wednesday-may-4/

If you edit the event you'll notice the time on the calendar is the time the event was published.

Expected behavior
If you look at an example without WP Rocket enabled the calendar times display correctly: https://www.williamsnd.com/calendar

Screenshots
Incorrect time display:
https://www.santa-ana.org/library-calendar/
Screen Shot 2022-05-09 at 9 27 55 AM

Event shows correct time (different from calendar widget)
Screen Shot 2022-05-09 at 9 31 49 AM

Time in the calendar widget matches published on time:
Screen Shot 2022-05-09 at 9 28 49 AM

Correct display: https://www.williamsnd.com/calendar (not using wp-rocket)
Screen Shot 2022-05-09 at 9 27 46 AM

@jlyon
Copy link
Contributor

jlyon commented May 12, 2022

@curtismchale This is using https://wp-events-plugin.com/ with https://wordpress.org/plugins/wp-fullcalendar/. It looks like they might have another solution for calendars and we might not need the full-blown fullcalendar JS library (which is massive) for sites that want to show a calendar (Display your events in various AJAX-powered calendars, ranging from simple full and small-sized calendars which are easy to style and incorporate into your site design. Go even further with our snazzy FullCalendar add-on!).

In Kevin's testing the culprit was definitely wp-rocket (he said that the datetimes were fixed when logged in once we disabled admin caching, but still broken for anon users). For https://www.santa-ana.org/library-calendar/, we might just be able to disable wp-rocket on that specific page (Kevin said that's the only page they're using fullcalendar on), but that probably won't scale as we rollout wp-rocket to everyone.

@aschmoe
Copy link
Member

aschmoe commented May 12, 2022

@curtismchale

Screen Shot 2022-05-12 at 12 53 18 PM

looks like we could probably just init something like

if (typeof WPFC == 'undefined') {
  var WPFC = {};
}

up in the header or whatever. The offending code is coming from the plugin in wp-fullcalendar.php

@aschmoe
Copy link
Member

aschmoe commented May 12, 2022

@curtismchale though I am seeing on the Williams site:

<script id=wp-fullcalendar-js-extra>
  var WPFC = {"ajaxurl":"https:\/\/www.williamsnd.com\/wp-admin\/admin-ajax.php?action=WP_FullCalendar","firstDay":"0","wpfc_theme":"jquery-ui","wpfc_limit":"10","wpfc_limit_txt":"more ...","timeFormat":"h(:mm)t","defaultView":"month","weekends":"true","header":{"left":"prev,next today","center":"title","right":"month,basicWeek,basicDay"},"wpfc_qtips":""};
</script> 
<script src='https://www.williamsnd.com/wp-content/plugins/wp-fullcalendar/includes/js/main.js?ver=1.4.1' id=wp-fullcalendar-js></script>

which I'm not seeing in the markup on santa ana... so not sure whats up with that.

@jlyon
Copy link
Contributor

jlyon commented May 13, 2022

Setting these Never cache urls on https://www.santa-ana.org/wp-admin/options-general.php?page=wprocket#advanced_cache didn't seem to fix it.

@jlyon
Copy link
Contributor

jlyon commented May 13, 2022

Here's more details on the calendar options with wp-events-manager. The non-fullcalendar version looks pretty bad... https://wp-events-plugin.com/documentation/calendars/

@kevindherman
Copy link
Author

@jlyon @curtismchale @aschmoe I'm looking at https://www.santa-ana.org/library-calendar/ and it's displaying the correct times. Could there just have been a delay?

@aschmoe
Copy link
Member

aschmoe commented Jun 2, 2022

@curtismchale https://github.com/wp-plugins/wp-fullcalendar/blob/master/wp-fullcalendar.php#L145 this is what was missing from the dom in the full calendar case, fyi.

@curtismchale
Copy link
Contributor

After review we've resolved this with a change to the JS settings in WP Rocket. Everything appears to work fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants