Skip to content

Commit

Permalink
Fix first day locale
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Dec 9, 2021
1 parent 2239047 commit 3a4179d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 23 deletions.
4 changes: 2 additions & 2 deletions apps/files_sharing/js/dist/files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/files_sharing/js/dist/files_sharing_tab.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion apps/files_sharing/src/components/SharingEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
}"
:class="{ error: errors.expireDate}"
:disabled="saving"
:first-day-of-week="firstDay"
:lang="lang"
:value="share.expireDate"
value-type="format"
Expand Down
3 changes: 1 addition & 2 deletions apps/files_sharing/src/components/SharingEntryLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
}"
class="share-link-expire-date"
:disabled="saving"
:first-day-of-week="firstDay"

:lang="lang"
icon=""
type="date"
Expand Down Expand Up @@ -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"
Expand Down
21 changes: 4 additions & 17 deletions apps/files_sharing/src/mixins/SharesMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,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
Expand All @@ -131,16 +118,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',
}
},

Expand Down

0 comments on commit 3a4179d

Please sign in to comment.