Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DateTimePicker example and translation #3405

Merged
merged 1 commit into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions l10n/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -122,24 +122,6 @@ 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
17 changes: 9 additions & 8 deletions src/components/NcDatetimePicker/NcDatetimePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
export default {
data() {
return {
time: null,
time: new Date('2022-10-10 10:10:10'),
}
},
}
Expand Down Expand Up @@ -168,7 +168,7 @@ export default {
<script>
import NcTimezonePicker from '../NcTimezonePicker/index.js'
import NcPopover from '../NcPopover/index.js'
import { t } from '../../l10n.js'
import l10n from '../../mixins/l10n.js'

import {
getFirstDay,
Expand Down Expand Up @@ -199,6 +199,7 @@ export default {
NcTimezonePicker,
},

mixins: [l10n],
inheritAttrs: false,

props: {
Expand Down Expand Up @@ -312,21 +313,21 @@ export default {
*/
defaultPlaceholder() {
if (this.type === 'time') {
return t('Pick a time')
return this.t('Pick a time')
}
if (this.type === 'month') {
return t('Pick a month')
return this.t('Pick a month')
}
if (this.type === 'year') {
return t('Pick a year')
return this.t('Pick a year')
}
if (this.type === 'week') {
return t('Pick a week')
return this.t('Pick a week')
}
if (this.type === 'date') {
return t('Pick a date')
return this.t('Pick a date')
}
return t('Pick a date and a time')
return this.t('Pick a date and a time')
},

/**
Expand Down