-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add option to show browser's local time #1653
Conversation
Oh no, I forgot to add tests again. Will do tomorrow! |
1f2efef
to
9580aa1
Compare
@vichyavin this looks good to me. Perhaps you could change the documentation strings a little:
...is a bit unclear. If I understand the point of this PR correctly, it would perhaps be better phrased by: `Use the browser's local timezone instead of the server's for displaying dates." @bartkamphorst any thoughts? |
@vichyavin it also looks like one of the tests is failing on JRuby: https://travis-ci.org/github/gollum/gollum/jobs/754610273 Could you investigate? Thanks! |
5c59ad4
to
d816ebd
Compare
@dometto Done! |
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.
Thanks @vichyavin. One more suggestion for refactoring in the comments. Sorry for not mentioning it earlier.
Again, thanks for the contribution and patience, @NikitaIvanovV! |
This PR adds an option to show browser's local time when viewing history, commit, latest_changes and clicking
When was this page last modified?
button.I used the client-side approach: I pass time in
datetime
attribute of<time>
tag and then JS creates a Date object, which will be in borwser's local time. To supportstrftime
(used for formatting Time in latest_changes and history) on the client, I had to include Datejs library. I hope adding another library for such a minor thing is not a big problem?