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

Inconsistency between parsing and coercions for datetimes #8

Open
m-haug opened this issue May 29, 2024 · 1 comment
Open

Inconsistency between parsing and coercions for datetimes #8

m-haug opened this issue May 29, 2024 · 1 comment
Labels
coercions Issue or PR relating to valkyrie coercions enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@m-haug
Copy link

m-haug commented May 29, 2024

Firstly, thank you for the package; it seems to be a great help to package authors.

However, I encountered an issue when using coercions with datetime objects. The date schema function accepts any datetime object (even time only), while the coercion only works for actual dates, without a time component. I think it would be best to split this into three different types, according to the amount of precision: dates, times, and datetimes. Then each of those could have separate schema and coercion functions.

What do you think?

@jamesrswift
Copy link
Member

That sounds like a good suggestion. I haven't had a chance to think too deeply on this yet, but my first impression is that it would make sense to focus on the coercions; to have a coercion for dates, times, and date times. It would also make sense to introduce some method of composing coercions.

When I finish work, I'll try some different solutions out and put them here, to see which you think is most intuitive/useful/customizable.

@jamesrswift jamesrswift added enhancement New feature or request coercions Issue or PR relating to valkyrie coercions labels May 29, 2024
@jamesrswift jamesrswift added this to the 0.2.1 milestone May 29, 2024
@jamesrswift jamesrswift added the help wanted Extra attention is needed label Jul 12, 2024
@jamesrswift jamesrswift modified the milestones: 0.2.1, v0.2.2 Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coercions Issue or PR relating to valkyrie coercions enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants