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

Support model-attribute of type: :date #42

Open
A5308Y opened this issue Nov 23, 2021 · 1 comment
Open

Support model-attribute of type: :date #42

A5308Y opened this issue Nov 23, 2021 · 1 comment

Comments

@A5308Y
Copy link
Collaborator

A5308Y commented Nov 23, 2021

No description provided.

@A5308Y A5308Y changed the title Support attribute with type: :date Support model-attribute of type: :date Nov 23, 2021
@A5308Y
Copy link
Collaborator Author

A5308Y commented Nov 23, 2021

I just realised we have :date_time and it gets parsed as a ruby DateTime, which we almost certainly don't need here.

https://ruby-doc.org/stdlib-2.6.1/libdoc/date/rdoc/DateTime.html says:

So when should you use DateTime in Ruby and when should you use Time? Almost certainly you’ll want to use Time since your app is probably dealing with current dates and times. However, if you need to deal with dates and times in a historical context you’ll want to use DateTime to avoid making the same mistakes as UNESCO. If you also have to deal with timezones then best of luck - just bear in mind that you’ll probably be dealing with local solar times, since it wasn’t until the 19th century that the introduction of the railways necessitated the need for Standard Time and eventually timezones.

This is a major gotcha coming considering what "datetime" often means in a DB context.

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

No branches or pull requests

1 participant