Skip to content

Commit

Permalink
Fix overwriting placeholder property
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
  • Loading branch information
Chartman123 committed Sep 8, 2022
1 parent 08a64cc commit c034b32
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
18 changes: 18 additions & 0 deletions l10n/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,24 @@ msgstr ""
msgid "People & Body"
msgstr ""

msgid "Pick a date"
msgstr ""

msgid "Pick a date and a time"
msgstr ""

msgid "Pick a month"
msgstr ""

msgid "Pick a time"
msgstr ""

msgid "Pick a week"
msgstr ""

msgid "Pick a year"
msgstr ""

msgid "Pick an emoji"
msgstr ""

Expand Down
21 changes: 13 additions & 8 deletions src/components/NcDatetimePicker/NcDatetimePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default {
:formatter="formatter"
:lang="lang"
:minute-step="minuteStep"
:placeholder="placeholder"
:placeholder="placeholder ? placeholder : defaultPlaceholder"
:popup-class="{ 'show-week-number': showWeekNumber }"
:show-week-number="showWeekNumber"
:type="type"
Expand Down Expand Up @@ -266,6 +266,11 @@ export default {
type: Boolean,
default: false,
},
placeholder: {
type: String,
default: null,
},
},
emits: [
Expand Down Expand Up @@ -307,23 +312,23 @@ export default {
*
* @return {string}
*/
placeholder() {
defaultPlaceholder() {
if (this.type === 'time') {
return this.t('Pick a time')
return t('Pick a time')
}
if (this.type === 'month') {
return this.t('Pick a month')
return t('Pick a month')
}
if (this.type === 'year') {
return this.t('Pick a year')
return t('Pick a year')
}
if (this.type === 'week') {
return this.t('Pick a week')
return t('Pick a week')
}
if (this.type === 'date') {
return this.t('Pick a date')
return t('Pick a date')
}
return this.t('Pick a date and a time')
return t('Pick a date and a time')
},
/**
Expand Down

0 comments on commit c034b32

Please sign in to comment.