From a4fdc582c3908f8457d705a6a45d89739e6461db Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 29 Oct 2026 21:54:51 -0400 Subject: [PATCH 1/4] fix(settings): use localized relative time for background jobs Moments uses the locale instead of the language for localization. Replace Moment formatting in BackgroundJob with Nextcloud Vue's useFormatRelativeTime composable. Fixes #45069 Fixes https://github.com/nextcloud-libraries/nextcloud-moment/issues/1061 Signed-off-by: Josh --- .../src/components/BasicSettings/BackgroundJob.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/settings/src/components/BasicSettings/BackgroundJob.vue b/apps/settings/src/components/BasicSettings/BackgroundJob.vue index 1f14bf579d07c..bd4a520ca28fe 100644 --- a/apps/settings/src/components/BasicSettings/BackgroundJob.vue +++ b/apps/settings/src/components/BasicSettings/BackgroundJob.vue @@ -76,6 +76,7 @@ import NcCheckboxRadioSwitch from '@nextcloud/vue/components/NcCheckboxRadioSwit import NcNoteCard from '@nextcloud/vue/components/NcNoteCard' import NcSettingsSection from '@nextcloud/vue/components/NcSettingsSection' import logger from '../../logger.ts' +import { useFormatRelativeTime } from '@nextcloud/vue/composables/useFormatDateTime' const lastCron = loadState('settings', 'lastCron') const cronMaxAge = loadState('settings', 'cronMaxAge', '') @@ -93,6 +94,13 @@ export default { NcNoteCard, }, + setup() { + return { + relativeTime: useFormatRelativeTime(lastCron * 1000), + maxAgeRelativeTime: useFormatRelativeTime(cronMaxAge * 1000), + } + }, + data() { return { lastCron, @@ -101,8 +109,6 @@ export default { cliBasedCronPossible, cliBasedCronUser, backgroundJobsDocUrl, - relativeTime: moment(lastCron * 1000).fromNow(), - maxAgeRelativeTime: moment(cronMaxAge * 1000).fromNow(), } }, From 9ef4009b59f6aee31dfb26961d866d8a843778dc Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 30 Oct 2026 08:20:17 -0400 Subject: [PATCH 2/4] fix(settings): use locale-aware formatting for locale example Replace Moment with useFormatTime to format the example using the current user's locale. Use useNow to preserve one-second updates and automatically clean up the timer on unmount. Closes #45069 Assisted-by: Copilot:gpt-6.1-sol Signed-off-by: Josh --- .../LocaleSection/LocaleSectionEntry.vue | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/apps/settings/src/components/PersonalInfo/LocaleSection/LocaleSectionEntry.vue b/apps/settings/src/components/PersonalInfo/LocaleSection/LocaleSectionEntry.vue index 00a6cdec23e2f..c1d7145d078aa 100644 --- a/apps/settings/src/components/PersonalInfo/LocaleSection/LocaleSectionEntry.vue +++ b/apps/settings/src/components/PersonalInfo/LocaleSection/LocaleSectionEntry.vue @@ -6,7 +6,8 @@