Skip to content

fix(photo-addon): use 24-hour time format in lightbox#341

Open
paul43210 wants to merge 5 commits intoowncloud:mainfrom
paul43210:feat-photo-addon-24h-time
Open

fix(photo-addon): use 24-hour time format in lightbox#341
paul43210 wants to merge 5 commits intoowncloud:mainfrom
paul43210:feat-photo-addon-24h-time

Conversation

@paul43210
Copy link
Contributor

Summary

  • Use hour12: false in toLocaleDateString() for the "Date Taken" field in the photo lightbox
  • Shows 14:30 instead of 2:30 PM — AM/PM is US-centric and confusing for international users
  • One-line change in PhotoLightbox.vue formatExifDate()

Test plan

  • Open a photo in the lightbox
  • Verify "Date Taken" shows time in 24-hour format (e.g., "Jan 15, 2024, 14:30")
  • Verify it works across different browser locales

🤖 Generated with Claude Code

paul43210 and others added 3 commits March 17, 2026 16:31
Use hour12: false in toLocaleDateString() so the "Date Taken" field
in the lightbox shows 14:30 instead of 2:30 PM. AM/PM notation is
US-centric and confusing for international users.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Several date formatting calls in PhotosView and usePhotos were using
browser default locale (undefined) instead of the oCIS user's preferred
language. Now consistently uses getUserLocale() from useTranslations
for timeline group labels (week ranges, month names, full dates).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove hardcoded hour12: false from formatExifDate — the oCIS user
locale already determines the appropriate time format (e.g., en-US
uses 12h, de uses 24h). Addresses Lukas's review on owncloud#342.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@paul43210 paul43210 force-pushed the feat-photo-addon-24h-time branch from e090b92 to 936c54f Compare March 17, 2026 20:31
@mmattel
Copy link
Contributor

mmattel commented Mar 18, 2026

Findings after testing:

  1. ✔️ It shows, depending on the ocis locale, am/pm
  2. ❌ But it does not show the right format when using am/pm
    In the EN image shown below, this should be 1:56 pm

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

DE:
image

EN:
image

toLocaleDateString handles time options (hour, minute) inconsistently
across browsers — in EN locale it showed "13:56 PM" instead of
"1:56 PM". Switch to toLocaleString which correctly handles both
date and time formatting per the oCIS user locale.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@paul43210
Copy link
Contributor Author

Thanks for testing Martin!

This latest push fixes a bug where toLocaleDateString() was being used with time options (hour, minute). That's the wrong API for date+time — it handles time formatting inconsistently across browsers. Switched to toLocaleString() which properly formats both date and time per the oCIS user locale.

Regarding the time values in your screenshots — 12:56 on a 24-hour clock (DE) is the same as 12:56 PM on a 12-hour clock (EN), so both are actually showing the correct time. Were you perhaps looking at different photos when comparing, or could there be a timezone difference involved? The expected 1:56 PM would correspond to 13:56, not 12:56.

The tooltip previously implied the filter checked for any EXIF metadata
(camera, model, location, etc.), but it actually filters by EXIF date
(takenDateTime). Updated tooltip to accurately describe the behavior
and explain that EXIF date is required for timeline placement, just as
EXIF location is required for map view.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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