diff --git a/pkg/core/calendar.go b/pkg/core/calendar.go index 4aba05e2..07a34390 100644 --- a/pkg/core/calendar.go +++ b/pkg/core/calendar.go @@ -7,10 +7,11 @@ type CalendarDisplayType byte // Calendar Display Type const ( - CALENDAR_DISPLAY_TYPE_DEFAULT CalendarDisplayType = 0 - CALENDAR_DISPLAY_TYPE_GREGORAIN CalendarDisplayType = 1 - CALENDAR_DISPLAY_TYPE_BUDDHIST CalendarDisplayType = 2 - CALENDAR_DISPLAY_TYPE_INVALID CalendarDisplayType = 255 + CALENDAR_DISPLAY_TYPE_DEFAULT CalendarDisplayType = 0 + CALENDAR_DISPLAY_TYPE_GREGORAIN CalendarDisplayType = 1 + CALENDAR_DISPLAY_TYPE_BUDDHIST CalendarDisplayType = 2 + CALENDAR_DISPLAY_TYPE_GREGORAIN_WITH_CHINESE CalendarDisplayType = 3 + CALENDAR_DISPLAY_TYPE_INVALID CalendarDisplayType = 255 ) // String returns a textual representation of the calendar display type enum @@ -22,6 +23,8 @@ func (f CalendarDisplayType) String() string { return "Gregorian" case CALENDAR_DISPLAY_TYPE_BUDDHIST: return "Buddhist" + case CALENDAR_DISPLAY_TYPE_GREGORAIN_WITH_CHINESE: + return "Gregorian with Chinese" case CALENDAR_DISPLAY_TYPE_INVALID: return "Invalid" default: diff --git a/pkg/models/user.go b/pkg/models/user.go index cb4a2465..b984af1f 100644 --- a/pkg/models/user.go +++ b/pkg/models/user.go @@ -199,7 +199,7 @@ type UserProfileUpdateRequest struct { DefaultCurrency string `json:"defaultCurrency" binding:"omitempty,len=3,validCurrency"` FirstDayOfWeek *core.WeekDay `json:"firstDayOfWeek" binding:"omitempty,min=0,max=6"` FiscalYearStart *core.FiscalYearStart `json:"fiscalYearStart" binding:"omitempty,validFiscalYearStart"` - CalendarDisplayType *core.CalendarDisplayType `json:"calendarDisplayType" binding:"omitempty,min=0,max=2"` + CalendarDisplayType *core.CalendarDisplayType `json:"calendarDisplayType" binding:"omitempty,min=0,max=3"` DateDisplayType *core.DateDisplayType `json:"dateDisplayType" binding:"omitempty,min=0,max=2"` LongDateFormat *core.LongDateFormat `json:"longDateFormat" binding:"omitempty,min=0,max=3"` ShortDateFormat *core.ShortDateFormat `json:"shortDateFormat" binding:"omitempty,min=0,max=3"` diff --git a/pkg/services/users.go b/pkg/services/users.go index 07ab1593..dea64afc 100644 --- a/pkg/services/users.go +++ b/pkg/services/users.go @@ -293,7 +293,7 @@ func (s *UserService) UpdateUser(c core.Context, user *models.User, modifyUserLa updateCols = append(updateCols, "fiscal_year_start") } - if core.CALENDAR_DISPLAY_TYPE_DEFAULT <= user.CalendarDisplayType && user.CalendarDisplayType <= core.CALENDAR_DISPLAY_TYPE_BUDDHIST { + if core.CALENDAR_DISPLAY_TYPE_DEFAULT <= user.CalendarDisplayType && user.CalendarDisplayType <= core.CALENDAR_DISPLAY_TYPE_GREGORAIN_WITH_CHINESE { updateCols = append(updateCols, "calendar_display_type") } diff --git a/src/components/common/DateTimePicker.vue b/src/components/common/DateTimePicker.vue index 6797d98a..3b269d56 100644 --- a/src/components/common/DateTimePicker.vue +++ b/src/components/common/DateTimePicker.vue @@ -3,7 +3,7 @@ inline auto-apply enable-seconds six-weeks="center" - :class="datetimePickerClass" + :class="`datetime-picker ${showAlternateDates && alternateCalendarType ? 'datetime-picker-with-alternate-date' : ''} ${datetimePickerClass}`" :config="noSwipeAndScroll ? { noSwipe: true } : undefined" :dark="isDarkMode" :vertical="vertical" @@ -35,7 +35,10 @@ {{ getDisplayMonth(value) }}