modify style

This commit is contained in:
MaysWind
2025-06-10 00:10:57 +08:00
parent f9d8293fd2
commit 8d5fe8f0f1
3 changed files with 30 additions and 8 deletions
@@ -1,13 +1,18 @@
import { ref, computed } from 'vue';
import { type WeekDayValue } from '@/core/datetime.ts';
import { FiscalYearStart } from '@/core/fiscalyear.ts';
import { arrangeArrayWithNewStartIndex } from '@/lib/common.ts';
import { useI18n } from '@/locales/helpers.ts';
import { useUserStore } from '@/stores/user.ts';
import { type WeekDayValue } from '@/core/datetime.ts';
import { FiscalYearStart } from '@/core/fiscalyear.ts';
import { arrangeArrayWithNewStartIndex } from '@/lib/common.ts';
import {
getLocalDatetimeFromUnixTime,
getThisYearFirstUnixTime,
getThisYearLastUnixTime
} from '@/lib/datetime.ts';
export interface CommonFiscalYearStartSelectionProps {
modelValue?: number;
disabled?: boolean;
@@ -79,6 +84,9 @@ export function useFiscalYearStartSelectionBase(props: CommonFiscalYearStartSele
return formatMonthDayToLongDay(fiscalYearStart.toMonthDashDayString());
});
const allowedMinDate = computed<Date>(() => getLocalDatetimeFromUnixTime(getThisYearFirstUnixTime()));
const allowedMaxDate = computed<Date>(() => getLocalDatetimeFromUnixTime(getThisYearLastUnixTime()));
const firstDayOfWeek = computed<WeekDayValue>(() => userStore.currentUserFirstDayOfWeek);
const dayNames = computed<string[]>(() => arrangeArrayWithNewStartIndex(getAllMinWeekdayNames(), firstDayOfWeek.value));
@@ -90,6 +98,8 @@ export function useFiscalYearStartSelectionBase(props: CommonFiscalYearStartSele
// computed states
selectedFiscalYearStartValue,
displayFiscalYearStartDate,
allowedMinDate,
allowedMaxDate,
firstDayOfWeek,
dayNames
};