client-go icon indicating copy to clipboard operation
client-go copied to clipboard

Date fields shouldn't be time.Time

Open nathanhack opened this issue 1 year ago • 0 comments

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 avatar Dec 26 '24 17:12 nathanhack