Skip to content
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

refactor: add local timezone aware date format #577

Merged
merged 1 commit into from
Aug 23, 2019

Conversation

lorenzo-cavazzi
Copy link
Member

The commit datetime showed to the user while launching a new notebook is now local timezone aware.

fix #571

@lorenzo-cavazzi lorenzo-cavazzi requested a review from a team as a code owner August 22, 2019 09:52
Copy link
Contributor

@ciyer ciyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Could you add a test for toIsoTimezoneString (just 1 is fine)?

@lorenzo-cavazzi
Copy link
Member Author

It turns out that it's not that easy to create a proper unit test because JavaScript doesn't allow to create a new date for a specific timezone https://stackoverflow.com/questions/15141762/how-to-initialize-a-javascript-date-to-a-particular-time-zone

I added a pretty long piece of code to test on the current user timezone. Basically, it works on string manipulation. This is the best way that came to my mind to avoid writing a test that is simply a re-write of the function to be tested. The other way would be adding an external library for time management, which doesn't look like a good way to test it either.

ciyer
ciyer previously approved these changes Aug 23, 2019
@lorenzo-cavazzi
Copy link
Member Author

just rebased and squashed since it's a single topic

@lorenzo-cavazzi lorenzo-cavazzi merged commit 0db9a17 into master Aug 23, 2019
@lorenzo-cavazzi lorenzo-cavazzi deleted the 571-timezone-aware-dates branch August 23, 2019 14:21
@lorenzo-cavazzi lorenzo-cavazzi added this to the 0.6.4 milestone Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

notebooks: git commit timestamps use UTC
2 participants