Skip to content

feat(advanced-search): align date display to oCIS locale#351

Closed
paul43210 wants to merge 2 commits intoowncloud:mainfrom
paul43210:feat-advanced-search-locale
Closed

feat(advanced-search): align date display to oCIS locale#351
paul43210 wants to merge 2 commits intoowncloud:mainfrom
paul43210:feat-advanced-search-locale

Conversation

@paul43210
Copy link
Contributor

Summary

  • Dates in search results now use the user's oCIS preferred language setting instead of hardcoded ISO format (YYYY-MM-DD)
  • formatDate() updated to accept optional locale parameter, uses toLocaleDateString() with the oCIS user locale
  • Added formatDateTime() helper with 24-hour time format for future use
  • Locale is read from userStore.user.preferredLanguage (oCIS account setting), falling back to browser default

Examples:

  • English: "Mar 16, 2026"
  • German: "16. Mär. 2026"
  • French: "16 mars 2026"

Test plan

  • Set oCIS user language to German → dates display in German format
  • Set oCIS user language to English → dates display in English format
  • Search results (list and table view) show locale-formatted dates
  • Saved queries panel shows locale-formatted dates
  • Photo "Date Taken" column shows locale-formatted dates

🤖 Generated with Claude Code

paul43210 and others added 2 commits March 17, 2026 16:30
Use the user's oCIS preferred language setting (from userStore) for
date formatting instead of hardcoded ISO format. Dates now display
in the user's locale (e.g., "16 Mar 2026" for en, "16. Mär. 2026"
for de). Added formatDateTime() helper with 24-hour time format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove hardcoded hour12: false — the locale already determines the
appropriate time format (e.g., en-US uses 12h, de uses 24h).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@paul43210 paul43210 force-pushed the feat-advanced-search-locale branch from 536f50f to 70eec79 Compare March 17, 2026 20:30
@mmattel
Copy link
Contributor

mmattel commented Mar 18, 2026

Findings after testing:

❌ the date format shown in the input field does not change based on the locale settings
In DE, this should be yyyy/mm/dd

Note that I did a browser force reload after changing the locale on the search page.

DE:
image

EN:
image

@paul43210
Copy link
Contributor Author

Thanks for testing Martin!

The date input fields use <input type="date">, which is a native browser control — the browser renders the display format based on its own locale, not anything we can control from JavaScript. The underlying value is always ISO format (YYYY-MM-DD) regardless of how the browser displays it. For me it shows as yyyy-mm-dd.

The locale changes in this PR affect the formatted date text elsewhere in the UI (saved query timestamps, result dates, etc.), not the native date picker inputs.

Could you point me to an existing example in oCIS/web where a date picker respects the oCIS language setting? I'd be happy to build a custom date input component that formats according to the user's oCIS language preference, but I want to make sure we're aligning with how other parts of the UI handle this — and honestly, the oCIS "Language" setting is a language preference, not a full locale (which would include regional date/number formatting). So it's not clear what the expected date format for "DE" should be — Germany uses dd.mm.yyyy, Austria uses dd.mm.yyyy too, but Switzerland might differ.

Let me know how you'd like to proceed — happy to build something if there's a clear spec to follow.

@paul43210
Copy link
Contributor Author

To add to the above — a language setting alone isn't enough to determine date format. For example, "English" in the US uses mm/dd/yyyy, but "English" in Canada uses yyyy-mm-dd, and "English" in the UK uses dd/mm/yyyy. Same language, three different date formats.

If we want custom date pickers that respect a specific format, oCIS preferences would need a true Locale setting (e.g., en-US, en-CA, en-GB, de-DE, de-AT) rather than just a Language setting (en, de). Without that, we'd be guessing at regional formatting.

@mmattel
Copy link
Contributor

mmattel commented Mar 23, 2026

Closing via #352

@mmattel mmattel closed this Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants