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

Date fields shouldn't be time.Time #486

Open
nathanhack opened this issue Dec 26, 2024 · 0 comments
Open

Date fields shouldn't be time.Time #486

nathanhack opened this issue Dec 26, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@nathanhack
Copy link

nathanhack commented Dec 26, 2024

Is your feature request related to a problem? Please describe.
Time is hard.
The models.* fields that are dates "YYYY-MM-DD" shouldn't be time.Time.
It can lead to unexpected edge cases for anyone who's time.Location doesn't satisfy time.Local==time.UTC .
Instead the fields should be something like civil.Date (which is already used in the repo).

Describe the solution you'd like
Since civil.Date is already used in the repo I think ideally the date fields should be changed to civil.Date.

Additional context
Currently the library has it's own models.Date struct. And it uses time.Parse("2006-01-02", unquoteData) which forces parsing to be UTC.
See this for examples https://go.dev/play/p/roCLT-sUC0V

@nathanhack nathanhack added the enhancement New feature or request label Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant