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

Format dates according to user locales, not language #189

Merged
merged 3 commits into from
Feb 20, 2024

Conversation

1ec5
Copy link
Member

@1ec5 1ec5 commented Jan 5, 2024

Replaced the current language code with the array of preferred locale codes in the date fields and date-related validation rules added in #185, #187, and #188.

Day, month, year, era

Fixes OpenHistoricalMap/issues#670.

@1ec5 1ec5 added the bug label Jan 5, 2024
@1ec5 1ec5 self-assigned this Jan 5, 2024
@@ -51,7 +51,7 @@ export function validationFormatting() {
if (edtfFromOSM) {
let label;
try {
label = edtf.default(edtfFromOSM).format(localizer.languageCode());
label = edtf.default(edtfFromOSM).format(localizer.localeCode());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon code inspection, edtf.js seems to expect a single locale string here, not an array of them like the built-in functions.

@1ec5 1ec5 requested a review from erictheise February 14, 2024 22:32
@erictheise erictheise merged commit c82c3e8 into staging Feb 20, 2024
2 checks passed
@erictheise erictheise deleted the 1ec5-date-locale-670 branch February 20, 2024 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Date field ordering should vary by region, not just by language
2 participants