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

end_of_day/1 should be comparable with inspect #12449

Closed
josevalim opened this issue Mar 6, 2023 · 2 comments · Fixed by #12450
Closed

end_of_day/1 should be comparable with inspect #12449

josevalim opened this issue Mar 6, 2023 · 2 comments · Fixed by #12450

Comments

@josevalim
Copy link
Member

One way to look at it is we should be able to write the assertion under question using just sigils:

assert NaiveDateTime.end_of_day(~N[2000-01-01 23:00:07]) == ~N[2000-01-01 23:59:59]

and the fact we can't is a reason to revisit this?

Originally posted by @wojtekmach in #12443 (comment)

@josevalim
Copy link
Member Author

We should probably truncate it based on the precision: {(10 ** precision) - 1, precision}

@thiamsantos
Copy link
Contributor

That makes sense. I will open a PR.

@whatyouhide whatyouhide changed the title end of day should be comparable with inspect end_of_day/1 should be comparable with inspect Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants