]> 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)
committerLouis Chemineau <louis@chmn.me>
Thu, 16 Dec 2021 10:17:51 +0000 (11:17 +0100)
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
apps/files_sharing/src/mixins/SharesMixin.js

index 4349e10d641bcc252f6b265403d0a1ea5ae914df..f07be65836da7fcfdea0a75415348389857359ac 100644 (file)
@@ -117,17 +117,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'),
                                },
                        }
                },