Home › Forums › General [ No Support Zone ] › Feature Request › Dates, Times and Timezones
Tagged: timezone
- This topic has 7 replies, 3 voices, and was last updated 7 years, 5 months ago by lewiskeyte.
Viewing 8 posts - 1 through 8 (of 8 total)
-
AuthorPosts
-
March 21, 2016 at 2:17 pm #37901Ravi Kiran KathaParticipantHello Mr. Vibe, I had recently purchased this theme and currently in the setting up phase. I have a very basic requirement regarding the times/schedules applicable across various current features in the theme - for e.g. Course batch schedules (currently being developed), event schedules etc. The dates/times need to be timezone aware. This helps the students visiting the portal from across different timezones. A practical scenario for the requirement is when the Wordpress timezone is TZx and a student from TZy wants to enroll for a course or attend an online webinar event. As of now, the complete portal shows times/dates in TZx. So the user has to calculate the time difference for each date/time displayed to correlate them in his/her own timezone - TZy. This applies to the other user types - like the Instructors & Admins from other timezones, when they create/edit an online ILT (Instructor Led Training) course or an event, they should calculate the time difference between TZx & TZy before entering the schedules. I have the following suggestions for the implementing this feature
- Admin Back-End
- The admin back-end can accept an extra optional timezone parameter, wherever it takes date/time values. If not specified, defaults to the portal timezone.
- Front-End
- All date/time display areas can be emitted using a short code [local_time] or similar
- This short code can be implemented inside the theme or as a new plugin
- This new implementation should also add a Timezone Selector widget, which can be injected into the header or footer or anywhere else (may be using another short code time_zone_switcher). This selector shows or allows to change the timezone in which the dates/times are shown in the portal
- The selector checks for a session cookie for user's timezone preference. If a session cookie is not found, the presence of a persistent cookie is checked. If the session cookie is not found but the persistent cookie is found, the persistent cookie is copied over to the session cookie. At the end of this processing, if a session cookie is found, it is used as the preferred timezone. Else the user's timezone is detected from the browser and saved as session cookie. If the user changes/sets a specific timezone from the timezone switcher, it is saved to the session and persistent cookies. The switcher should allow to reset the cookies to restore the detection behavior.
- The [local_time] shortcode shall display the date/times in the currently selected timezone resulting from the above step
March 28, 2016 at 7:24 am #39118MrVibeKeymasterYes, we use the TimeZone setting saved in WP Admin - Settings - General section where ever it is sensitive. In most cases we display the time difference rather than actual date and time value. If in cases it is not working correctly then it is bug not a feature :). It would be great if you can point out exact steps where you think we should improve.March 28, 2016 at 7:47 am #39131Ravi Kiran KathaParticipantThanks for the reply. I am not talking about any issue with the theme. The dates/times can be stored in the database with respect to the wordpress timezone => I am sure the theme already does this. When we display the dates/times in the front-end, they all get displayed in Wordpress timezone. There is no bug in this implementation either. Lets consider the following scenario- The wordpress timezone is Pacific time
- We have an online webinar event scheduled at 11 AM (which means 11 AM PT)
- A user from EST timezone visits the website
- He sees "11 AM" or "11 AM PT" on the front-end based on the wordpress time display format
- In either case, for him to attend that webinar, he has to check the time difference between EST (his own timezone) to that of the portal timezone (PT) which is about 3 hrs. So he has to be ready by 2 PM EST
April 16, 2016 at 9:36 am #43306Ravi Kiran KathaParticipantAny comment or suggestion or workaround?April 18, 2016 at 12:59 pm #43534MrVibeKeymasterAlthough your point is valid. My thoughts on this is that is where ever this is sensitive we show the difference, so instead of user seeing :- He sees "11 AM" or "11 AM PT" on the front-end based on the wordpress time display format
- He sees "12 hours" remaining
April 19, 2016 at 5:38 am #43652Ravi Kiran KathaParticipantAttached a screenshot with the time display. Show "time from now" notation would not solve the problem. The calculation will still be complex if the event is a distant event. How difficult is to set wordpress timezone per request? If that is feasible, we can use some javascript libraries (like jstz) and set a cookie with the current user's timezone. That cookie can be checked for every request on the backend as the first step & wordpress timezone setting can be set for that request. That avoids using geolocation api and still leaves all other code intact without any required modifications.April 23, 2016 at 2:12 pm #44569Ravi Kiran KathaParticipantNever mind, I was able to create a Wordpress Plugin to cater to this requirement. No need to implement in the theme. The plugin is at WP User Timezone for your reference. Thanks & Regards RaviJuly 19, 2017 at 4:33 am #121392lewiskeyteParticipantHi, I'm also having an issue with this. Specifically, the event timing is not timezone aware. When creating an event, a user can put in a time and timezone; this is reflected in the event listing, but does not change based on the user timezone. By itself, this is an issue but can be lived with. Unfortunately, the ICS file downloaded from the event is not adjusted, so calendar applications (which assume the ICS file timestamps are in UTC) add/subtract the user's timezone. The screenshots (event creation in the admin, event listing on the site, and opening the event in Outlook) and .ics file are at this link: <span class="download_link_link" style="color: #409fff; word-wrap: break-word;">https://we.tl/Yo8YnvRinV</span> I've contacted EventOn support but was told to contact the creators of WPLMS since EventOn came bundled with it. I also tried the WP User Timezone plugin above - it detects the timezone, but does not change the times displayed in event listings. -
AuthorPosts
Viewing 8 posts - 1 through 8 (of 8 total)
- The topic ‘Dates, Times and Timezones’ is closed to new replies.