-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
MAINT: Fix doc date #8787
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
MAINT: Fix doc date #8787
Conversation
e3129be to
d393670
Compare
|
I have a fix for this already in #8757 that just uses one line in and one line in EDIT oh, I see you're actually doing the same thing, just with a bunch of (unnecessary?) javascript to put the last updated timestamp into the user's local time zone? |
Yes the difference is that the javascript localizes to both the user's time zone and their local date expression, which is to me much nicer than UTC's very long formatting in time zone that is often not the viewer's |
I guess the long formatting only really matters if you include the time. I think it's nice to have in there as a dev but maybe users don't need it. And I guess we could localize the date at least, but this is probably a bit overkill since the YYYY-MM-DD format is probably okay, and weird stuff like the site showing an updated-date that is ahead of your actual date should be rare. So I can just change this to be your solution for a quicker merge to master and backport if you prefer @drammock ... |
|
I'm starting to see the value of having the timestamp in there, for devs. WDYT about YYYY-MM-DD hh:mm:ss (basically follow ISO 8601 but replace |
|
Especially if it's for devs then having the timezone is useful, though. If I see some date in UTC I don't know the conversion immediately and I can never remember if it changes during the year due to daylight savings. Even if I teach myself the rules and internalize them then every dev needs to keep track of this if they want to actually know the date/time that something changed. Another hint that this formatting is useful/standard is if you look at this commit on GitHub and mouseover the date that says "4 hours ago", for example on my machine it says "Jan 25, 2021 8:04 AM EST" not UTC. I'm assuming this is localized to each viewer. |
|
... looks like on GitHub this is done with: and after the page loads something (presumably JavaScript?) adds a |
drammock
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK you've convinced me to accept the extra code for localized time. FWIW I'm seeing 01/25/2021 10:50 AM CST which may be the "standard format" in the country I live in but is definitely not my preferred way of seeing dates/times (I prefer YYYY-MM-DD and 24hr times).
|
Looks like GitHub uses probably |
Back in #7532 I broke the
Last updatedtag at the bottom of the website, and it has read "Last updated on 2020-03-27." ever since. With this PR I now get "Last updated 01/25/2021, 11:32 AM EST" and each person should get the equivalent datetime in their own timezone.