mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Fix #4113: Calendar showMonthAfterYear locale option
This commit is contained in:
parent
f3d1033c37
commit
12174a1f96
3 changed files with 58 additions and 24 deletions
|
@ -85,30 +85,62 @@
|
|||
</slot>
|
||||
</button>
|
||||
<div :class="cx('title')" v-bind="ptm('title')">
|
||||
<button
|
||||
v-if="currentView === 'date'"
|
||||
type="button"
|
||||
@click="switchToMonthView"
|
||||
@keydown="onContainerButtonKeydown"
|
||||
:class="cx('monthTitle')"
|
||||
:disabled="switchViewButtonDisabled"
|
||||
:aria-label="$primevue.config.locale.chooseMonth"
|
||||
v-bind="ptm('monthTitle')"
|
||||
>
|
||||
{{ getMonthName(month.month) }}
|
||||
</button>
|
||||
<button
|
||||
v-if="currentView !== 'year'"
|
||||
type="button"
|
||||
@click="switchToYearView"
|
||||
@keydown="onContainerButtonKeydown"
|
||||
:class="cx('yearTitle')"
|
||||
:disabled="switchViewButtonDisabled"
|
||||
:aria-label="$primevue.config.locale.chooseYear"
|
||||
v-bind="ptm('yearTitle')"
|
||||
>
|
||||
{{ getYear(month) }}
|
||||
</button>
|
||||
<span v-if="$primevue.config.locale.showMonthAfterYear">
|
||||
<button
|
||||
v-if="currentView !== 'year'"
|
||||
type="button"
|
||||
@click="switchToYearView"
|
||||
@keydown="onContainerButtonKeydown"
|
||||
:class="cx('yearTitle')"
|
||||
:disabled="switchViewButtonDisabled"
|
||||
:aria-label="$primevue.config.locale.chooseYear"
|
||||
v-bind="ptm('yearTitle')"
|
||||
data-pc-group-section="view"
|
||||
>
|
||||
{{ getYear(month) }}
|
||||
</button>
|
||||
<button
|
||||
v-if="currentView === 'date'"
|
||||
type="button"
|
||||
@click="switchToMonthView"
|
||||
@keydown="onContainerButtonKeydown"
|
||||
:class="cx('monthTitle')"
|
||||
:disabled="switchViewButtonDisabled"
|
||||
:aria-label="$primevue.config.locale.chooseMonth"
|
||||
v-bind="ptm('monthTitle')"
|
||||
data-pc-group-section="view"
|
||||
>
|
||||
{{ getMonthName(month.month) }}
|
||||
</button>
|
||||
</span>
|
||||
<span v-else>
|
||||
<button
|
||||
v-if="currentView === 'date'"
|
||||
type="button"
|
||||
@click="switchToMonthView"
|
||||
@keydown="onContainerButtonKeydown"
|
||||
:class="cx('monthTitle')"
|
||||
:disabled="switchViewButtonDisabled"
|
||||
:aria-label="$primevue.config.locale.chooseMonth"
|
||||
v-bind="ptm('monthTitle')"
|
||||
data-pc-group-section="view"
|
||||
>
|
||||
{{ getMonthName(month.month) }}
|
||||
</button>
|
||||
<button
|
||||
v-if="currentView !== 'year'"
|
||||
type="button"
|
||||
@click="switchToYearView"
|
||||
@keydown="onContainerButtonKeydown"
|
||||
:class="cx('yearTitle')"
|
||||
:disabled="switchViewButtonDisabled"
|
||||
:aria-label="$primevue.config.locale.chooseYear"
|
||||
v-bind="ptm('yearTitle')"
|
||||
data-pc-group-section="view"
|
||||
>
|
||||
{{ getYear(month) }}
|
||||
</button>
|
||||
</span>
|
||||
<span v-if="currentView === 'year'" :class="cx('decadeTitle')" v-bind="ptm('decadeTitle')">
|
||||
<slot name="decade" :years="yearPickerValues"> {{ yearPickerValues[0].value }} - {{ yearPickerValues[yearPickerValues.length - 1].value }} </slot>
|
||||
</span>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue