-
Notifications
You must be signed in to change notification settings - Fork 244
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
Calendar shows US date format in UK locale #2777
Comments
I can confirm that I too have the exact same issue. Please see the screenshot of my language/locale settings with today showing the correct way: And then how the calendar shows the 10th of January: I believe this was introduced when I upgraded from 19.x to 20.x. It is a pretty sore bug for me, as I can easily lead to very irritating calendar mistakes, especially for the first 12 days of every month. Below my server details: Server configuration detailOperating system: Linux 4.15.0-130-generic #134-Ubuntu SMP Tue Jan 5 20:46:26 UTC 2021 x86_64 Webserver: nginx/1.14.0 (fpm-fcgi) Database: mysql 5.7.32 PHP version: 7.2.24-0ubuntu0.18.04.7 Nextcloud version: 20.0.4 - 20.0.4.0 Updated from an older Nextcloud/ownCloud or fresh install: Where did you install Nextcloud from: unknown Signing statusArray List of activated apps
Configuration (config/config.php)
Are you using external storage, if yes which one: local/smb/sftp/... Are you using encryption: Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... Client configurationBrowser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0 |
I have the same issue. Language is set to English (US) and locale to German (Germany). Dates are shown in Month/Day/Year format, which is not german format. Nextcloud version: 20.0.8 |
I have an update on this issue. I just noticed some weird behavior on this, when switching the view modes in calendar. Preconditions:
Steps:
Can anybody confirm this? Can anybody reproduce this in his/her set up? |
When I change my language to 'English (British English)', the dates are shown in the correct way. Could it be that the calendar app looks at the language rather than the locale when deciding how to format the dates? |
Is there a possibility to promote this issue? It seems like there hasn't been any reaction to it yet, or am I missing something? |
We are having this issue with Nextcloud 21.0.2 as well, the locale is set to Dutch and the language to English (US). Setting the language to English (English British) solves the problem. Weird thing is that some parts are being translated to Dutch with the British setting where it did not with the US setting, the online status menu for instance. |
I was able to reproduce this behavior. Infortunately, the calendar goes back to the unwanted state. |
Ok, so I had a look into the code and tried to find the possible source of this problem. I'm neither familiar with vue.js nor with the nextcloud code base, so I might be wrong. I think though this particular portion could be causing the issue: File: https://github.com/nextcloud/calendar/blob/master/src/utils/moment.js export default async function loadMomentLocalization() {
const locale = getLocale().replace('_', '-').toLowerCase()
const language = getLanguage().replace('_', '-').toLowerCase()
if (locale === language) {
return getLocaleFor(locale)
}
const [realLocale, realLanguage] = await Promise.all([getLocaleFor(locale), getLocaleFor(language)])
if (realLocale === realLanguage) {
return realLocale
}
const name = `nextcloud-calendar-fake-locale-${realLocale}-${realLanguage}`
moment.defineLocale(name, {
parentLocale: realLanguage,
longDateFormat: {
LT: moment.localeData(realLocale).longDateFormat('LT'),
LTS: moment.localeData(realLocale).longDateFormat('LTS'),
L: moment.localeData(realLocale).longDateFormat('L'),
LL: moment.localeData(realLocale).longDateFormat('LL'),
LLL: moment.localeData(realLocale).longDateFormat('LLL'),
LLLL: moment.localeData(realLocale).longDateFormat('LLLL'),
},
week: {
dow: moment.localeData(realLocale).firstDayOfWeek(),
doy: moment.localeData(realLocale).firstDayOfYear(),
},
})
return name
} It seems correct to differentiate between language and locale if they are not equal and to build a "custom" locale that contains parts of the language and the locale. One probably still wants week days to be translated to the correct language but the date to be formatted in the custom other locale. That's is quite tricky I guess. Question: Maybe the These are just some thoughts. I haven't actually debugged this, since I am not experienced with debugging nextcloud apps. I might try that another time but maybe someone else feels like debugging this in the meantime and check what exactly is going on here. |
@mrbenjoi your observations seem to match nextcloud/server#14784. I guess it's the same unsolved problem. |
@ChristophWurst thanks for your reation. Would it rather makes sense to reopen that issue or to create a new issue? It seems that this problem causes several bugs and should have an own issue. What do you think? For all others waiting for a fix on this issue: If we repoen that other issue you might want to support the fix of the problem by leaving a comment or reaction there, as soon as it is open again. |
The issue is at nextcloud/server#15457 and it's still open. |
Ok, I will leave a comment at nextcloud/server#15457 with a reference to here. @AnyBody: If you're affected please show your affection using the 👍 button on the OPs or my comment. |
The issue is still there in:
When I use Language = en_US and Locale = fr_FR, I get Mon 8/30/2021 instead of Lun 30/08/2021. I suggest changing the issue title with something like "Calendar formats date according to language instead of locale", which is a more generic description of the issue. NB: If I understand correctly, the issue at Timestamps are not displayed in the preffered language is different from this issue. According to issue #15457, the date should be neither "Mon 8/30/2021", nor "Lun 30/08/2021", but "Mon 30/08/2021", which is a more complex issue. For instance, when using linux with english language and french date format, the dates are still written in french. |
This comment has been minimized.
This comment has been minimized.
I opened #4739 for the same issue. It's still a problem on 25.0.1 |
I tried to reproduce this issue locally and it works as expected now. I couldn't find a combination of language and locale where the formatting in Calendar didn't match the preview below the locale setting. There have been multiple improvements and fixes to locale handling in the meantime. I'll open a PR to fix the first day of the week shortly. If someone is still facing the issue stated here, please let us know. Otherwise, I'm inclined to close this issue. |
Steps to reproduce
Expected behaviour
The calendar should use the locale's date format.
Actual behaviour
The calendar uses US date format.
Calendar app
Calendar app version: 2.1.3
CalDAV-clients used: macOS Calendar, DAVx5 (Android)
Client configuration
Browser: Firefox 84.0.2
Operating system: macOS 10.14.6
Server configuration
Operating system: Ubuntu 18.04.5 LTS
Web server: Nginx reverse proxy to snap (apache?)
Database: Whatever is in the snap (mysql?)
PHP version: Whatever is in the snap.
Nextcloud Version: 20.0.4
Updated from an older installed version or fresh install: Fresh yesterday.
List of activated apps:
Nextcloud configuration:
Logs
These are tricky for me to get right now. Please ask if you think they are relevant.
The text was updated successfully, but these errors were encountered: