mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 00:12:11 +08:00
migrate consts/datetime.js to ts
This commit is contained in:
@@ -59,7 +59,7 @@ import { useTheme } from 'vuetify';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useUserStore } from '@/stores/user.js';
|
||||
|
||||
import datetimeConstants from '@/consts/datetime.js';
|
||||
import { DateRange } from '@/core/datetime.ts';
|
||||
import { ThemeType } from '@/core/theme.ts';
|
||||
import { arrangeArrayWithNewStartIndex } from '@/lib/common.ts';
|
||||
import {
|
||||
@@ -149,12 +149,12 @@ export default {
|
||||
const presetRanges = [];
|
||||
|
||||
[
|
||||
datetimeConstants.allDateRanges.Today,
|
||||
datetimeConstants.allDateRanges.LastSevenDays,
|
||||
datetimeConstants.allDateRanges.LastThirtyDays,
|
||||
datetimeConstants.allDateRanges.ThisWeek,
|
||||
datetimeConstants.allDateRanges.ThisMonth,
|
||||
datetimeConstants.allDateRanges.ThisYear
|
||||
DateRange.Today,
|
||||
DateRange.LastSevenDays,
|
||||
DateRange.LastThirtyDays,
|
||||
DateRange.ThisWeek,
|
||||
DateRange.ThisMonth,
|
||||
DateRange.ThisYear
|
||||
].forEach(dateRangeType => {
|
||||
const dateRange = getDateRangeByDateType(dateRangeType.type, this.firstDayOfWeek);
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ import { mapStores } from 'pinia';
|
||||
import { useSettingsStore } from '@/stores/setting.js';
|
||||
import { useUserStore } from '@/stores/user.js';
|
||||
|
||||
import { DEFAULT_ICON_COLOR, DEFAULT_CHART_COLORS } from '@/consts/color.ts';
|
||||
import datetimeConstants from '@/consts/datetime.js';
|
||||
import statisticsConstants from '@/consts/statistics.js';
|
||||
import { DateRangeScene } from '@/core/datetime.ts';
|
||||
import { ThemeType } from '@/core/theme.ts';
|
||||
import { DEFAULT_ICON_COLOR, DEFAULT_CHART_COLORS } from '@/consts/color.ts';
|
||||
import statisticsConstants from '@/consts/statistics.js';
|
||||
import {
|
||||
isArray,
|
||||
isNumber
|
||||
@@ -376,7 +376,7 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
const dateRangeType = getDateTypeByDateRange(minUnixTime, maxUnixTime, this.userStore.currentUserFirstDayOfWeek, datetimeConstants.allDateRangeScenes.Normal);
|
||||
const dateRangeType = getDateTypeByDateRange(minUnixTime, maxUnixTime, this.userStore.currentUserFirstDayOfWeek, DateRangeScene.Normal);
|
||||
|
||||
this.$emit('click', {
|
||||
itemId: itemId,
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
import { mapStores } from 'pinia';
|
||||
import { useUserStore } from '@/stores/user.js';
|
||||
|
||||
import datetimeConstants from '@/consts/datetime.js';
|
||||
import { DateRange } from '@/core/datetime.ts';
|
||||
import { arrangeArrayWithNewStartIndex } from '@/lib/common.ts';
|
||||
import {
|
||||
getCurrentUnixTime,
|
||||
@@ -136,12 +136,12 @@ export default {
|
||||
const presetRanges = [];
|
||||
|
||||
[
|
||||
datetimeConstants.allDateRanges.Today,
|
||||
datetimeConstants.allDateRanges.LastSevenDays,
|
||||
datetimeConstants.allDateRanges.LastThirtyDays,
|
||||
datetimeConstants.allDateRanges.ThisWeek,
|
||||
datetimeConstants.allDateRanges.ThisMonth,
|
||||
datetimeConstants.allDateRanges.ThisYear
|
||||
DateRange.Today,
|
||||
DateRange.LastSevenDays,
|
||||
DateRange.LastThirtyDays,
|
||||
DateRange.ThisWeek,
|
||||
DateRange.ThisMonth,
|
||||
DateRange.ThisYear
|
||||
].forEach(dateRangeType => {
|
||||
const dateRange = getDateRangeByDateType(dateRangeType.type, this.firstDayOfWeek);
|
||||
|
||||
|
||||
@@ -52,7 +52,6 @@
|
||||
import { mapStores } from 'pinia';
|
||||
import { useUserStore } from '@/stores/user.js';
|
||||
|
||||
import datetimeConstants from '@/consts/datetime.js';
|
||||
import { arrangeArrayWithNewStartIndex } from '@/lib/common.ts';
|
||||
import {
|
||||
getCurrentUnixTime,
|
||||
@@ -202,19 +201,15 @@ export default {
|
||||
return getTimeValues(datetime, this.is24Hour, this.isMeridiemIndicatorFirst);
|
||||
},
|
||||
getTimePickerColumns() {
|
||||
const self = this;
|
||||
const ret = [];
|
||||
|
||||
if (!self.is24Hour && this.isMeridiemIndicatorFirst) {
|
||||
ret.push({
|
||||
values: datetimeConstants.allMeridiemIndicatorsArray,
|
||||
displayValues: self.$locale.getAllMeridiemIndicatorNames()
|
||||
});
|
||||
if (!this.is24Hour && this.isMeridiemIndicatorFirst) {
|
||||
ret.push(this.$locale.getAllMeridiemIndicators());
|
||||
}
|
||||
|
||||
// Hours
|
||||
ret.push({
|
||||
values: self.generateAllHours()
|
||||
values: this.generateAllHours()
|
||||
});
|
||||
// Divider
|
||||
ret.push({
|
||||
@@ -223,7 +218,7 @@ export default {
|
||||
});
|
||||
// Minutes
|
||||
ret.push({
|
||||
values: self.generateAllMinutesOrSeconds()
|
||||
values: this.generateAllMinutesOrSeconds()
|
||||
});
|
||||
// Divider
|
||||
ret.push({
|
||||
@@ -232,14 +227,11 @@ export default {
|
||||
});
|
||||
// Seconds
|
||||
ret.push({
|
||||
values: self.generateAllMinutesOrSeconds()
|
||||
values: this.generateAllMinutesOrSeconds()
|
||||
});
|
||||
|
||||
if (!self.is24Hour && !this.isMeridiemIndicatorFirst) {
|
||||
ret.push({
|
||||
values: datetimeConstants.allMeridiemIndicatorsArray,
|
||||
displayValues: self.$locale.getAllMeridiemIndicatorNames()
|
||||
});
|
||||
if (!this.is24Hour && !this.isMeridiemIndicatorFirst) {
|
||||
ret.push(this.$locale.getAllMeridiemIndicators());
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -93,8 +93,8 @@ import { mapStores } from 'pinia';
|
||||
import { useSettingsStore } from '@/stores/setting.js';
|
||||
import { useUserStore } from '@/stores/user.js';
|
||||
|
||||
import { DateRangeScene } from '@/core/datetime.ts';
|
||||
import { DEFAULT_ICON_COLOR, DEFAULT_CHART_COLORS } from '@/consts/color.ts';
|
||||
import datetimeConstants from '@/consts/datetime.js';
|
||||
import statisticsConstants from '@/consts/statistics.js';
|
||||
import { isNumber } from '@/lib/common.ts';
|
||||
import {
|
||||
@@ -303,7 +303,7 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
const dateRangeType = getDateTypeByDateRange(minUnixTime, maxUnixTime, this.userStore.currentUserFirstDayOfWeek, datetimeConstants.allDateRangeScenes.Normal);
|
||||
const dateRangeType = getDateTypeByDateRange(minUnixTime, maxUnixTime, this.userStore.currentUserFirstDayOfWeek, DateRangeScene.Normal);
|
||||
|
||||
this.$emit('click', {
|
||||
itemId: itemId,
|
||||
|
||||
Reference in New Issue
Block a user