Implements comprehensive date localization support across the application by centralizing dayjs configuration and adding locale-aware date formatting.
Added
New centralized dayjs configuration in src/lib/dayjs.js
Added updateDayjsLocale function to handle locale changes
Added support for additional dayjs plugins: isToday, isYesterday
Automatic locale switching based on user language preferences
Changed
Updated date formatting to use localized formats
Modified formatDate utility to provide more natural relative time expressions
Refactored dayjs imports to use centralized configuration
Updated date display format to be more locale-aware:
Recent dates show relative time like "2 hours ago"
Yesterday's dates show as "Yesterday"
Older dates use localized long format
Fixed
Inconsistent date formatting across the application
Missing locale support for date displays
Additional Information
This change ensures consistent date formatting throughout the application while respecting user locale preferences
Date formats will automatically update when the user changes their language preference
The implementation uses dayjs's built-in localization support for maximum compatibility
I added comments where I deemed necessary for clarity
Checklist
Target branch: Targeting dev branch
Description: Provided detailed description of changes
Changelog: Added comprehensive changelog entry
Code review: Performed self-review of code
Testing: Tested date formatting with various locales
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/9767
**Author:** [@JoeSlain](https://github.com/JoeSlain)
**Created:** 2/10/2025
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `localize-time`
---
### 📝 Commits (1)
- [`129ef50`](https://github.com/open-webui/open-webui/commit/129ef50d058c5c6788f8be79e6a79e668ed90934) feat: localize dates
### 📊 Changes
**4 files changed** (+38 additions, -9 deletions)
<details>
<summary>View changed files</summary>
📝 `src/lib/components/admin/Users/UserList.svelte` (+1 -1)
📝 `src/lib/dayjs.js` (+22 -0)
📝 `src/lib/utils/index.ts` (+6 -8)
📝 `src/routes/+layout.svelte` (+9 -0)
</details>
### 📄 Description
# Pull Request: feat: localize dates
### Description
Implements comprehensive date localization support across the application by centralizing dayjs configuration and adding locale-aware date formatting.
### Added
- New centralized dayjs configuration in `src/lib/dayjs.js`
- Added `updateDayjsLocale` function to handle locale changes
- Added support for additional dayjs plugins: `isToday`, `isYesterday`
- Automatic locale switching based on user language preferences
### Changed
- Updated date formatting to use localized formats
- Modified `formatDate` utility to provide more natural relative time expressions
- Refactored dayjs imports to use centralized configuration
- Updated date display format to be more locale-aware:
- Recent dates show relative time like "2 hours ago"
- Yesterday's dates show as "Yesterday"
- Older dates use localized long format
### Fixed
- Inconsistent date formatting across the application
- Missing locale support for date displays
## Additional Information
- This change ensures consistent date formatting throughout the application while respecting user locale preferences
- Date formats will automatically update when the user changes their language preference
- The implementation uses dayjs's built-in localization support for maximum compatibility
- I added comments where I deemed necessary for clarity
## Checklist
- [x] Target branch: Targeting `dev` branch
- [x] Description: Provided detailed description of changes
- [x] Changelog: Added comprehensive changelog entry
- [x] Code review: Performed self-review of code
- [x] Testing: Tested date formatting with various locales
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/9767
Author: @JoeSlain
Created: 2/10/2025
Status: ❌ Closed
Base:
dev← Head:localize-time📝 Commits (1)
129ef50feat: localize dates📊 Changes
4 files changed (+38 additions, -9 deletions)
View changed files
📝
src/lib/components/admin/Users/UserList.svelte(+1 -1)📝
src/lib/dayjs.js(+22 -0)📝
src/lib/utils/index.ts(+6 -8)📝
src/routes/+layout.svelte(+9 -0)📄 Description
Pull Request: feat: localize dates
Description
Implements comprehensive date localization support across the application by centralizing dayjs configuration and adding locale-aware date formatting.
Added
src/lib/dayjs.jsupdateDayjsLocalefunction to handle locale changesisToday,isYesterdayChanged
formatDateutility to provide more natural relative time expressionsFixed
Additional Information
Checklist
devbranch🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.