-
Notifications
You must be signed in to change notification settings - Fork 54
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
Make EDTF date input more intuitive for #2976 #3115
Make EDTF date input more intuitive for #2976 #3115
Conversation
If I understand correctly, the input mask performs validation instead of just suggesting text? And that means we won't be able to accept "1854" by itself as an input value? |
Okay, that sounds like we've asked you to implement the wrong thing. I see that the HTML specifications has some slightly different tools available instead of input mask: The Could you switch the mask to a |
This message error pops up when you press "Save changes" and could be edited to give clues about EDTF format. It could also be used in conjunction with a Personally, I don't like this because having different validations in different places across the site seems confusing/inconsistent. However, it is a more immediate validation and could make more sense to users. |
Let's just go with the |
OK, that's what's on this branch right now. |
So the problem with this is that if I type "1943" into the field and save it, it pads out the whole data to "1943-01-01". This is not desirable. EDTF says "1943" is a valid date, so it should accept that. |
It looks like the problem with the EDTF dates being padded to day precision is the
So, The good news is that the fromthepage/app/models/work.rb Lines 214 to 216 in f679cdd
So we still have access to the precision of all of the |
Should we check the string and decide how to display it/which EDTF precision to use based on what it contains? |
We'll manually check the length of the We'll include coverage for:
We probably won't include coverage for:
|
Tests fine. Merging. |
…-mask Make EDTF date input more intuitive for #2976
Resolves #2976
The problem
Currently, the "Document Date" field under "Additional Metadata" in work settings is required to be in ETDF format and a validation error pops up if it's not:
This works, but isn't very intuitive because some users (such as Molly of History Revealed, who emailed about this issue) don't know what EDTF format is or don't understand what the validation error means.
The solution
A better way to restrict dates to EDTF format is to use an input mask (to
yyyy-mm-dd
), this pull adds that.An issue
Though this works perfectly with dates at one specific day, there are more possible date types. EDTF allows:
The input mask doesn't allow any input outside of
yyyy-mm-dd
, so if we want to include other date types, this solution might not fit.