Skip to content

Commit

Permalink
enh(NcDatetimePicker): convert lang computed value to prop
Browse files Browse the repository at this point in the history
This allows to overwrite the locale configuration of the upstream date
picker library. Some apps (e.g. Calendar) overwrite some of the default
values which are specified here.

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
  • Loading branch information
st3iny committed Mar 29, 2023
1 parent 527eaf6 commit 2c044c6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/NcDatetimePicker/NcDatetimePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default {
:clearable="clearable"
:format="format ? format : formatTypeMap"
:formatter="formatter"
:lang="lang"
:lang="lang ? lang : defaultLang"
:minute-step="minuteStep"
:placeholder="placeholder ? placeholder : defaultPlaceholder"
:popup-class="{ 'show-week-number': showWeekNumber }"
Expand Down Expand Up @@ -237,6 +237,11 @@ export default {
default: null,
},

lang: {
type: Object,
default: null,
},

/**
* The value to initialize, but also two-way bind the selected date. The date is – like the `Date` object in
* JavaScript – tied to UTC. The selected time zone does not have an influence of the selected time and date
Expand Down Expand Up @@ -300,7 +305,7 @@ export default {
*
* @return {object}
*/
lang() {
defaultLang() {
return {
formatLocale: {
months: getMonthNames(),
Expand Down

0 comments on commit 2c044c6

Please sign in to comment.