inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,846
January 2015
msg
|
Post by Lynx on Apr 23, 2024 4:16:20 GMT -8
This is just an idea I had for a plugin, but I haven't started development yet as I need to find out if something like this is even doable. I suspect that this will need to make use of a super user key.
I believe that PB serverdate uses UTC. If this is correct, what I'd like to be able to do is have a popup show once for each user asking for their timezone in UTC, like UTC -5:00 (from a dropdown), to set their initial local time. The plugin would then calculate their time and display it in the MP.
Further down the road, provided this is possible in the first place, I'm thinking of changing from UTC to GMT (which looks to be affected by daylight savings time, whereas UTC does not) and including a checkbox on the popup to indicate whether it's DST or not. A button will also be placed on their profile (only seen if it's the user's own profile and not while viewing someone else's profile) where they can use it to adjust their timezone, via the same popup. Their current timezone setting and DST setting (once implemented) would be saved to a key so that user's time can be pulled from the key data and display the appropriate time in their MP.
Is something like this even doable with a plugin? If not, then there's no point in me even trying to make an attempt on this - hence why I'm looking to see if this is possible in the first place.
Thanks to any who reply.
|
|
Kami
Forum Cat
Posts: 40,198
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,198
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Apr 23, 2024 8:31:56 GMT -8
I can't speak to the plugin part as you know but one additional point of consideration: there are different terms for "DST" across the globe (eg: British Summer Time aka BST) so you may have to also factor in a way to localise or use a more generic term.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Apr 24, 2024 21:51:02 GMT -8
Lynx , the discussion in the Mention Time Zone of the board thread and the Phoenix Rising thread might shed some light on this. Basically, it took several years for the various browsers to adopt the Date.prototype.getTimezoneOffset() method, finally making it feasible to query that information from the user's device. In v4 there was an option in the user profile to select your timezone prior to that finally getting adopted. I vaguely recall doing a v4.5 script using that newly adopted Date.prototype.getTimezoneOffset() method that displayed the user's local time in their mini-profile with an opt-in only option to preserve privacy but for the life of me I cannot find it in search (might be in a board no longer accessible) Edit:
I found the old v4.5 code request: [RD] TZ time in MP? or Show User's Local Time in Mini-Profile. Hopefully that helps. You may also want to lean on the newer Intl interface to output standardized international Datetime formats.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,846
January 2015
msg
|
Post by Lynx on Apr 26, 2024 17:14:48 GMT -8
I can't speak to the plugin part as you know but one additional point of consideration: there are different terms for "DST" across the globe (eg: British Summer Time aka BST) so you may have to also factor in a way to localise or use a more generic term. Thank you for that info, Kami. Duly noted. Lynx , the discussion in the Mention Time Zone of the board thread and the Phoenix Rising thread might shed some light on this. Basically, it took several years for the various browsers to adopt the Date.prototype.getTimezoneOffset() method, finally making it feasible to query that information from the user's device. In v4 there was an option in the user profile to select your timezone prior to that finally getting adopted. I vaguely recall doing a v4.5 script using that newly adopted Date.prototype.getTimezoneOffset() method that displayed the user's local time in their mini-profile with an opt-in only option to preserve privacy but for the life of me I cannot find it in search (might be in a board no longer accessible) Edit:
I found the old v4.5 code request: [RD] TZ time in MP? or Show User's Local Time in Mini-Profile. Hopefully that helps. You may also want to lean on the newer Intl interface to output standardized international Datetime formats. Thank you very much for those links, Chris. I'll be sure to take a close look at them when I have time. I've bookmarked this thread so I can easily find it again.
|
|