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

fix Date/Instant construction for years 0 <= y < 100 #53

Merged
merged 1 commit into from
Apr 4, 2017

Conversation

anilanar
Copy link
Contributor

@anilanar anilanar commented Apr 4, 2017

Fixes #46.

Date constructors in JS assume years between 1900-1999 when year argument y is 0 <= y < 100.

Unfortunately there's no constructor function to overcome that assumption, the only way is to use setUTCFullYear.

I'm pretty new to PS so criticism is most welcome. 👍

@garyb
Copy link
Member

garyb commented Apr 4, 2017

This looks great, thanks!

I don't mind the duplicated function in the FFI (I saw the discussion on Slack), I think this is probably the best way to handle it to keep things as simple as possible in terms of FFI modules, etc.

@garyb garyb merged commit d211204 into purescript:master Apr 4, 2017
berdario added a commit to berdario/purescript-js-date that referenced this pull request Jun 11, 2017
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.

2 participants