From d2e5fb6a7ac0d10d0204bbce887f87379ccca5ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Thu, 9 Dec 2021 09:07:32 +0100 Subject: [PATCH] Fix first day locale MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- .../src/components/SharingEntry.vue | 1 - .../src/components/SharingEntryLink.vue | 3 +-- apps/files_sharing/src/mixins/SharesMixin.js | 21 ++++--------------- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue index 4baafcd96bc..107833496cc 100644 --- a/apps/files_sharing/src/components/SharingEntry.vue +++ b/apps/files_sharing/src/components/SharingEntry.vue @@ -102,7 +102,6 @@ }" :class="{ error: errors.expireDate}" :disabled="saving" - :first-day-of-week="firstDay" :lang="lang" :value="share.expireDate" value-type="format" diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue index 87ffbf703a7..e23a1e433c7 100644 --- a/apps/files_sharing/src/components/SharingEntryLink.vue +++ b/apps/files_sharing/src/components/SharingEntryLink.vue @@ -102,7 +102,7 @@ }" class="share-link-expire-date" :disabled="saving" - :first-day-of-week="firstDay" + :lang="lang" icon="" type="date" @@ -248,7 +248,6 @@ class="share-link-expire-date" :class="{ error: errors.expireDate}" :disabled="saving" - :first-day-of-week="firstDay" :lang="lang" :value="share.expireDate" value-type="format" diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js index f07be65836d..5bd97be1f2f 100644 --- a/apps/files_sharing/src/mixins/SharesMixin.js +++ b/apps/files_sharing/src/mixins/SharesMixin.js @@ -105,19 +105,6 @@ export default { return moment().add(1, 'days') }, - /** - * Datepicker lang values - * https://github.com/nextcloud/nextcloud-vue/pull/146 - * TODO: have this in vue-components - * - * @returns {int} - */ - firstDay() { - return window.firstDay - ? window.firstDay - : 0 // sunday as default - }, - // Datepicker language lang() { const weekdaysShort = window.dayNamesShort @@ -126,16 +113,16 @@ export default { const monthsShort = window.monthNamesShort ? window.monthNamesShort // provided by nextcloud : ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec.'] + const firstDayOfWeek = window.firstDay ? window.firstDay : 0 return { formatLocale: { + firstDayOfWeek, + monthsShort, weekdaysMin: weekdaysShort, weekdaysShort, - monthsShort, - }, - placeholder: { - date: t('files_sharing', 'Select Date'), }, + monthFormat: 'MMM', } },