From 22390479274c231d07f03fdc567dc87f010befbd Mon Sep 17 00:00:00 2001 From: John Molakvoæ Date: Thu, 9 Dec 2021 08:48:03 +0100 Subject: Properly format sharing datepicker locale MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- apps/files_sharing/src/mixins/SharesMixin.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'apps/files_sharing/src') diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js index b4da09c1b1c..8fe6388e45b 100644 --- a/apps/files_sharing/src/mixins/SharesMixin.js +++ b/apps/files_sharing/src/mixins/SharesMixin.js @@ -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'), }, } }, -- cgit v1.2.3