Browse Source

fix(nc-gui): nc-month selector

pull/7611/head
DarkPhoenix2704 10 months ago
parent
commit
a6699c0033
  1. 10
      packages/nc-gui/components/nc/MonthYearSelector.vue

10
packages/nc-gui/components/nc/MonthYearSelector.vue

@ -53,11 +53,11 @@ const isMonthSelected = (date: dayjs.Dayjs) => {
}
const paginateMonth = (action: 'next' | 'prev') => {
const date = dayjs(pageDate.value)
let date = dayjs(pageDate.value)
if (action === 'next') {
date.add(1, 'month')
date = date.add(1, 'year')
} else {
date.subtract(1, 'month')
date = date.subtract(1, 'year')
}
pageDate.value = date.toDate()
emit('update:pageDate', date.toDate())
@ -66,9 +66,9 @@ const paginateMonth = (action: 'next' | 'prev') => {
const paginateYear = (action: 'next' | 'prev') => {
let date = dayjs(pageDate.value)
if (action === 'next') {
date = date.add(1, 'year').clone()
date = date.add(12, 'year').clone()
} else {
date = date.subtract(1, 'year').clone()
date = date.subtract(12, 'year').clone()
}
pageDate.value = date.toDate()
emit('update:pageDate', date.toDate())

Loading…
Cancel
Save