userfrosting / UserFrosting

Modern PHP user login and management framework
https://www.userfrosting.com
Other
1.63k stars 367 forks source link

Add utc param to dateFormat #1222

Closed phillmac closed 1 year ago

phillmac commented 1 year ago

Is this a sane feature we should have? See https://github.com/tcort/handlebars-dateformat/issues/2 and https://github.com/tcort/handlebars-dateformat/commit/9d5021f639421e2b02db8c99b4e2981b0272dcbd and https://github.com/tcort/handlebars-dateformat/commit/9c3b4e9d41eb346b4c56ba7d84515124dc53d877

codecov[bot] commented 1 year ago

Codecov Report

Merging #1222 (ac61704) into master (adb574f) will not change coverage. The diff coverage is n/a.

@@            Coverage Diff            @@
##             master    #1222   +/-   ##
=========================================
  Coverage     69.64%   69.64%           
  Complexity     1987     1987           
=========================================
  Files           169      169           
  Lines          7677     7677           
=========================================
  Hits           5347     5347           
  Misses         2330     2330           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

phillmac commented 1 year ago

I suppose it's a little bit specific, but I'm pretty sure it could be useful elsewhere too. I have a series of GPS timestamps that are always in UTC regardless of any settings, time zone of the server, etc. They're stored as a integer because that's the raw data from the gps module. Being located in the GMT+1000 most of the year and GMT+1100 the rest makes it a bit of a pain to do conversions on the server, and not even that is a sure thing. There might be some in GMT+0930 or GMT+0800 sometimes. So it sems to me that it might be easier to do the conversion browser side. Not exactly sure if it's useful to anyone else, but at least one other person requested it sometime, that is, in the issue referenced above.