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

Add EDTF start and end date fields #187

Merged
merged 5 commits into from
Dec 20, 2023
Merged

Conversation

1ec5
Copy link
Member

@1ec5 1ec5 commented Dec 15, 2023

Added Start Date (EDTF) and End Date (EDTF) fields that automatically appear beneath the Start Date and End Date fields when the corresponding non-EDTF field is filled in.

Outdated screenshot Start Date (EDTF) field below Start Date field, but no End Date (EDTF) field below End Date field

This is just a plain field. Future enhancements can be tracked separately. For example, we could consolidate the EDTF fields with the Start Date and End Date fields, having them appear only when clicking the ➕ button, similar to how the localized name fields work. We can also implement validation and human-readable suggestions as a follow-up. ✔️

Fixes OpenHistoricalMap/issues#645. Depends on #185.

@1ec5 1ec5 self-assigned this Dec 15, 2023
@1ec5 1ec5 force-pushed the 1ec5-edtf-fields-645 branch from 1425220 to eddb334 Compare December 16, 2023 20:20
@1ec5
Copy link
Member Author

1ec5 commented Dec 17, 2023

I removed the separate fields for the start_date:edtf and end_date:edtf keys in favor of extending the date field type to manage *:edtf subkeys in the same manner that a localized field type manages language subkeys. The EDTF field only appears if the subkey is already set or if the user manually presses the ➕ button. This keeps the EDTF field from getting in the way, since two of them are right at the top of the inspector.

Extended Date/Time Format subfield

1ec5 added 2 commits December 16, 2023 23:03
Removed the separate fields for the start_date:edtf and end_date:edtf keys in favor of extending the date field type to manage *:edtf subkeys in the same manner that a localized field type manages language subkeys.
@1ec5 1ec5 force-pushed the 1ec5-edtf-fields-645 branch from 6f12efd to b4f6126 Compare December 17, 2023 07:04
@1ec5
Copy link
Member Author

1ec5 commented Dec 17, 2023

I added a validation rule for malformed EDTF dates:

Unexpected X

@1ec5
Copy link
Member Author

1ec5 commented Dec 18, 2023

I added another validation rule that checks whether start_date falls within the range specified by start_date:edtf and whether end_date falls within the range specified by end_date:edtf. If not, it suggests the start and end of the EDTF date’s range as substitutes in the main date tag:

Start date that falls outside of the EDTF start date

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

Successfully merging this pull request may close these issues.

Add EDTF-formatted Start Date and End Date fields to iD presets
2 participants