nextcloud / calendar

šŸ“† Calendar app for Nextcloud
https://apps.nextcloud.com/apps/calendar
GNU Affero General Public License v3.0
981 stars 241 forks source link

Calendar in 12- hour format despite choosing 24- hour format region and locale #6359

Open picard74 opened 1 month ago

picard74 commented 1 month ago

Steps to reproduce

1.Create calendar entry 2.Choose start time 3.Incorrect time format

Expected behavior

I expect a correct representation of the 24-hour time format.

Actual behaviour

I've encountered an issue where the times in the calendar are displayed in 12-hour format, despite setting the timezone to Germany. I've tried it on several Nextcloud instances, and the issue persists across all of them. The old trick of changing the region to Swiss German doesn't work anymore with Calendar version 5.0.

Calendar app version

5.0

CalDAV-clients used

No response

Browser

Firefox, google chrome

Client operating system

Windows 10

Server operating system

debian 12

Web server

Nginx

Database engine version

MariaDB

PHP engine version

Other

Nextcloud version

30.0.0

Updated from an older installed version or fresh install

Updated from an older version

List of activated apps

Enabled:
  - activity: 3.0.0
  - analytics: 5.0.1
  - announcementcenter: 7.0.0
  - appointments: 2.1.10
  - bruteforcesettings: 3.0.0
  - calendar: 5.0.0
  - call_summary_bot: 2.0.0
  - cloud_federation_api: 1.13.0
  - comments: 1.20.1
  - contacts: 6.1.0
  - contactsinteraction: 1.11.0
  - dashboard: 7.10.0
  - dav: 1.31.1
  - deck: 1.14.0
  - federatedfilesharing: 1.20.0
  - federation: 1.20.0
  - files: 2.2.0
  - files_accesscontrol: 1.20.1
  - files_antivirus: 5.5.7
  - files_downloadlimit: 3.0.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - firstrunwizard: 3.0.0
  - forms: 4.2.4
  - group_default_quota: 0.1.10
  - groupfolders: 18.0.1
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - nextcloud_announcements: 2.0.0
  - notes: 4.11.0
  - notifications: 3.0.0
  - oauth2: 1.18.1
  - onlyoffice: 9.3.0
  - password_policy: 2.0.0
  - photos: 3.0.2
  - polls: 7.2.3
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - spreed: 20.0.0
  - support: 2.0.0
  - survey_client: 2.0.0
  - systemtags: 1.20.0
  - tables: 0.8.0
  - text: 4.1.0
  - theming: 2.5.0
  - twofactor_backupcodes: 1.19.0
  - updatenotification: 1.20.0
  - user_status: 1.10.0
  - viewer: 3.0.0
  - weather_status: 1.10.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0
Disabled:
  - admin_audit: 1.20.0
  - circles: 30.0.0-dev (installed 25.0.0)
  - encryption: 2.18.0
  - files_external: 1.22.0 (installed 1.19.0)
  - files_mindmap: 0.0.30 (installed 0.0.30)
  - suspicious_login: 8.0.0
  - twofactor_nextcloud_notification: 4.0.0
  - twofactor_totp: 12.0.0-dev
  - user_ldap: 1.21.0

Nextcloud configuration

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "30.0.0.14",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "3306",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "de",
        "default_language": "de_DE",
        "default_locale": "de_DE",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "mail_smtpstreamoptions": {
            "ssl": {
                "allow_self_signed": true,
                "verify_peer": false,
                "verify_peer_name": false
            }
        },
        "app_install_overwrite": [
            "hancomoffice",
            "occweb",
            "deck",
            "shifts",
            "mindmap_app",
            "backup",
            "files_mindmap",
            "onlyoffice",
            "forms",
            "appointments",
            "files_antivirus"
        ],
        "theme": "",
        "loglevel": 2,
        "mail_smtpsecure": "ssl",
        "updater.release.channel": "stable",
        "maintenance_window_start": "17",
        "integrity.check.disabled": false,
        "defaultapp": ""
    }
}

Web server error log

inconspicuous

Log file

inconspicuous

Browser log

inconspicuous

Additional info

No response

miaulalala commented 1 month ago

Can you tell me both your language and locale please?

picard74 commented 1 month ago

Yes, language is German and Local is German (Deutschland)

micah commented 1 month ago

I'm also experiencing this after upgrading to Nextcloud 30. I've tried to set my personal locale settings to English (British), English (World), English (Europe), English (Canada), and nothing reverts it back to 24-hour time. I've also attempted to change my Language settings as well, with no update.

picard74 commented 1 month ago

Hallo. Can the issue with the hourly display be understood yet? Are there any updates regarding this issue? Thanks for your support.

targezed commented 1 month ago

Same here after upgrading 29 -> 30. France locale, English(US) language. Tried English(UK) but still get everything in the wrong formats: m/d/y 12h.

miaulalala commented 1 month ago

Unfortunately I had no luck reproducing this. I tried the following combinations:

German (formally and informally) with US locale -> shows correct format for US datetime, switching back to German locale works German with English (Switzerland) -> shows mm/dd/yyyy format, switching back to German and Austrian locale works.

Can you please check your logs for any errors when setting the locale in the Personal Settings section here?

Image

micah commented 1 month ago

On 2024-10-03 04:16:55, Anna wrote:

Unfortunately I had no luck reproducing this. I tried the following combinations:

German (formally and informally) with US locale -> shows correct format for US datetime, switching back to German locale works German with English (Switzerland) -> shows mm/dd/yyyy format, switching back to German and Austrian locale works.

The problem isn't with month, day, year, the problem is with 12hour vs. 24 hour time.

Can you please check your logs for any errors when setting the locale in the Personal Settings section here?

Image

If I set both of my options to German, as you show in your image, then sure I get 24 hour time. However, I cannot read German. Previously, the "Locale" setting of "English (Canada)" would also produce 24 hour time, but no longer does.

targezed commented 1 month ago

Hi,

Yes the little example in the settings page looks good, under the "locale" dropdown it is fine, but the "date of birth is not" :P Image

Then in calendar it does not change anything, I am still stuck with m/d/y and am/pm when displaying events: Image

Creating a new event is the same: Image

Here are the logs when I tried to switch to French language but it didn't change the formats in calendar: nc30.settings.to.french.log

picard74 commented 3 weeks ago

Hello, I found the issue. Initially, with Nextcloud 30, there was a workaround related to OnlyOffice. It involved a temporary adjustment in ContentSecurityPolicy.php. Here, the value of "protected$strictDynamicAllowedOnScripts" was adjusted. I have reverted this adjustment in the config, which initially was supposed to fix a problem with OnlyOffice. As a result, I have resolved the following issues:

12-hour calendar display document creation into files other minor errors This should also resolve the calendar issue here.

micah commented 2 weeks ago

Hello, I found the issue. Initially, with Nextcloud 30, there was a workaround related to OnlyOffice. It involved a temporary adjustment in ContentSecurityPolicy.php. Here, the value of "protected$strictDynamicAllowedOnScripts" was adjusted. I have reverted this adjustment in the config, which initially was supposed to fix a problem with OnlyOffice. As a result, I have resolved the following issues:

12-hour calendar display document creation into files other minor errors This should also resolve the calendar issue here.

You seem to be talking about https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues/1020 which involves setting protected $strictDynamicAllowedOnScripts from true to false.

I did do that, because of the OnlyOffice upgrade incompatibility, but when OnlyOffice was updated, I reverted that and I now have protected $strictDynamicAllowedOnScripts = true;, yet I still have the 12-hour calendar display issue. Was there something else you might have done?

picard74 commented 2 weeks ago

Hello, no, I haven't done anything else to solve the problem. Of course, reboot the entire instance afterward, but otherwise, it should run as it did before. When I open the calendar app, it always briefly shows in 12-hour format but switches to 24-hour format after a second.

micah commented 2 weeks ago

On 2024-10-15 05:19:33, picard74 wrote:

Hello, no, I haven't done anything else to solve the problem. Of course, reboot the entire instance afterward, but otherwise, it should run as it did before.

Yeah, I did put that variable back and the entire instance was rebooted, so I think there must be something else going on.