]> source.dussan.org Git - nextcloud-server.git/commitdiff
Properly format sharing datepicker locale
authorJohn Molakvoæ <skjnldsv@protonmail.com>
Thu, 9 Dec 2021 07:48:03 +0000 (08:48 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Fri, 10 Dec 2021 09:47:35 +0000 (09:47 +0000)
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
apps/files_sharing/src/mixins/SharesMixin.js

index b4da09c1b1c0652599401dfd7417ec1487b8fcb5..8fe6388e45bae4223d3165c6b158893138efcb26 100644 (file)
@@ -122,17 +122,24 @@ export default {
                                ? 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.']
+
                        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.'],
+                               formatLocale: {
+                                       weekdaysMin: weekdaysShort,
+                                       weekdaysShort,
+                                       monthsShort,
+                               },
                                placeholder: {
-                                       date: 'Select Date', // TODO: Translate
+                                       date: t('files_sharing', 'Select Date'),
                                },
                        }
                },