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

Implementing time zone change #5 #19

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sbencoding
Copy link

Hi!
This PR aims to implement the feature described in #5.
Here are some of the things I did:

  • Implement a time zone changing feature
  • Update docs
  • Write tests for the new change
  • Fix a previous test

I'm not sure what OP meant by setting time zone, the way I did it is it sets the timezone from the UTC time.
Example:
Let's suppose the time is 19:00:00 on a machine that's timezone is GMT +1.
We set time the timezone to GMT +2.
In this case my feature would return 20:00:00, because it's +2 from UTC time, and not from the given time.

Previous test case, that was broken:
I fixed a test case where it was testing the 2 digit format.
In this test case the input date is 2019-01-01 00:00:00 but with the GMT offset of the current machine, in my case this offset is +1, so the UTC date for me was 2018-12-31 23:00:00, which gives the 2 digit year of 18 instead of the expected 19

Building the docs:
I've read the guide in the readme file on building the docs, however I was unable to build the docs, because of an error that says TypeError: expected helpers to be an object.
If you could help me with what's wrong I could build the docs, because I'm not so familiar with verb.
I tried searching the docs but I haven't found anything related to the "helpers" package.json option.

Added setTimeZone function to lib
Added 4 tests for the new function including GMT +/- for specific and
current time also
Add fix to make test pass on non-GMT 0 locale machines
Added docs for new method to .verb.md
Updated typdef file with the new method's signature
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.

None yet

1 participant