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

Valkyrie::Types::Strict::DateTime broken? #830

Closed
hcayless opened this issue Jun 4, 2020 · 1 comment
Closed

Valkyrie::Types::Strict::DateTime broken? #830

hcayless opened this issue Jun 4, 2020 · 1 comment
Labels

Comments

@hcayless
Copy link
Contributor

hcayless commented Jun 4, 2020

I've found that I can't use the strict version of DateTime because various bits of conversion code use .utc to coerce to the UTC timezone (e.g. https://github.com/samvera/valkyrie/blob/master/lib/valkyrie/persistence/shared/json_value_mapper.rb#L155). Unfortunately, that results in the value being converted to a Time, which then promptly fails the strict checking because it's not a DateTime. It could probably be fixed by replacing calls to .utc with .utc.to_datetime.

I can work up a pull request if that's desirable.

@tpendragon
Copy link
Collaborator

@hcayless Good catch! We don't use strict types much personally, so I'm glad someone's exercising that bit. I'd love a pull request! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants