Clean up all kinds of typescript issues

This commit is contained in:
2024-05-05 15:58:58 -04:00
parent 634cff507c
commit 8e73650462
21 changed files with 380 additions and 159 deletions

View File

@@ -57,7 +57,7 @@ import { ref, reactive, computed } from 'vue';
const selectedDate = defineModel<string>();
const weekdays = reactive([0, 1, 2, 3, 4, 5, 6]),
const weekdays = reactive([1, 2, 3, 4, 5, 6, 0]),
locale = ref('en-CA'),
monthFormatter = monthFormatterFunc(),
dayFormatter = dayFormatterFunc(),
@@ -124,8 +124,14 @@ function dayClass(day: Timestamp) {
}
function monthFormatterFunc() {
const longOptions = { timeZone: 'UTC', month: 'long' };
const shortOptions = { timeZone: 'UTC', month: 'short' };
const longOptions: Intl.DateTimeFormatOptions = {
timeZone: 'UTC',
month: 'long',
};
const shortOptions: Intl.DateTimeFormatOptions = {
timeZone: 'UTC',
month: 'short',
};
return createNativeLocaleFormatter(locale.value, (_tms, short) =>
short ? shortOptions : longOptions
@@ -133,17 +139,28 @@ function monthFormatterFunc() {
}
function weekdayFormatterFunc() {
const longOptions = { timeZone: 'UTC', weekday: 'long' };
const shortOptions = { timeZone: 'UTC', weekday: 'short' };
const longOptions: Intl.DateTimeFormatOptions = {
timeZone: 'UTC',
weekday: 'long',
};
const shortOptions: Intl.DateTimeFormatOptions = {
timeZone: 'UTC',
weekday: 'short',
};
return createNativeLocaleFormatter(locale.value, (_tms, short) =>
short ? shortOptions : longOptions
);
}
function dayFormatterFunc() {
const longOptions = { timeZone: 'UTC', day: '2-digit' };
const shortOptions = { timeZone: 'UTC', day: 'numeric' };
const longOptions: Intl.DateTimeFormatOptions = {
timeZone: 'UTC',
day: '2-digit',
};
const shortOptions: Intl.DateTimeFormatOptions = {
timeZone: 'UTC',
day: 'numeric',
};
return createNativeLocaleFormatter(locale.value, (_tms, short) =>
short ? shortOptions : longOptions