diff options
Diffstat (limited to 'apps/files_sharing/src')
-rw-r--r-- | apps/files_sharing/src/components/SharingEntry.vue | 1 | ||||
-rw-r--r-- | apps/files_sharing/src/components/SharingEntryLink.vue | 3 | ||||
-rw-r--r-- | apps/files_sharing/src/mixins/SharesMixin.js | 36 |
3 files changed, 16 insertions, 24 deletions
diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue index 8167172ceea..ac7df24162c 100644 --- a/apps/files_sharing/src/components/SharingEntry.vue +++ b/apps/files_sharing/src/components/SharingEntry.vue @@ -100,7 +100,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 d860ee20805..3acd1a8652f 100644 --- a/apps/files_sharing/src/components/SharingEntryLink.vue +++ b/apps/files_sharing/src/components/SharingEntryLink.vue @@ -105,7 +105,7 @@ }" class="share-link-expire-date" :disabled="saving" - :first-day-of-week="firstDay" + :lang="lang" icon="" type="date" @@ -251,7 +251,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 b4da09c1b1c..15d3e2712cf 100644 --- a/apps/files_sharing/src/mixins/SharesMixin.js +++ b/apps/files_sharing/src/mixins/SharesMixin.js @@ -110,30 +110,24 @@ 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() { - // fallback to default in case of unavailable data + const weekdaysShort = window.dayNamesShort + ? window.dayNamesShort // provided by nextcloud + : ['Sun.', 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.', 'Sat.'] + 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 { - days: window.dayNamesShort - ? window.dayNamesShort // provided by nextcloud - : ['Sun.', 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.', 'Sat.'], - months: window.monthNamesShort - ? window.monthNamesShort // provided by nextcloud - : ['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec.'], - placeholder: { - date: 'Select Date', // TODO: Translate + formatLocale: { + firstDayOfWeek, + monthsShort, + weekdaysMin: weekdaysShort, + weekdaysShort, }, + monthFormat: 'MMM', } }, |