Skip to content

fix for {12,0} {am,pm} cases #26

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

Merged
merged 8 commits into from
Jul 19, 2017
Merged

Conversation

safareli
Copy link
Contributor

fix #25

Copy link
Member

@cryogenian cryogenian left a comment

Choose a reason for hiding this comment

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

👍

@safareli safareli changed the title fix for {P12,0} {am,pm} cases fix for {12,0} {am,pm} cases Jul 17, 2017
@safareli
Copy link
Contributor Author

safareli commented Jul 17, 2017

It needs to fail on: 24:1:40

let err = (Left "When hour is 24, other time component must be 0@1:24")
shouldEqual (FDT.unformatDateTime "YYYY-DD-MM HH:mm:ss:SSS" "0000-01-01 24:00:00:001") err
shouldEqual (FDT.unformatDateTime "YYYY-DD-MM HH:mm:ss:SSS" "0000-01-01 24:00:01:000") err
shouldEqual (FDT.unformatDateTime "YYYY-DD-MM HH:mm:ss:SSS" "0000-01-01 24:01:00:000") err
Copy link
Member

Choose a reason for hiding this comment

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

How do these pass? Is the "@1:24" in the error some magic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Can we print it as "When hour is 24, other time component must be 0 (line 1, col 24)" or something like that instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

@safareli safareli merged commit 1097e73 into purescript-contrib:master Jul 19, 2017
@safareli safareli deleted the ampm branch July 19, 2017 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

format unformat of {12,0} {am,pm}, 24
3 participants