mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 01:34:24 +08:00
user settings supports language and date&time format
This commit is contained in:
+109
-1
@@ -39,6 +39,96 @@ const allWeekDaysArray = [
|
||||
allWeekDays.Saturday
|
||||
];
|
||||
|
||||
const allLongDateFormat = {
|
||||
YYYYMMDD: {
|
||||
type: 1,
|
||||
key: 'yyyy_mm_dd'
|
||||
},
|
||||
MMDDYYYY: {
|
||||
type: 2,
|
||||
key: 'mm_dd_yyyy'
|
||||
},
|
||||
DDMMYYYY: {
|
||||
type: 3,
|
||||
key: 'dd_mm_yyyy'
|
||||
}
|
||||
};
|
||||
|
||||
const allLongDateFormatArray = [
|
||||
allLongDateFormat.YYYYMMDD,
|
||||
allLongDateFormat.MMDDYYYY,
|
||||
allLongDateFormat.DDMMYYYY
|
||||
];
|
||||
|
||||
const allShortDateFormat = {
|
||||
YYYYMMDD: {
|
||||
type: 1,
|
||||
key: 'yyyy_mm_dd'
|
||||
},
|
||||
MMDDYYYY: {
|
||||
type: 2,
|
||||
key: 'mm_dd_yyyy'
|
||||
},
|
||||
DDMMYYYY: {
|
||||
type: 3,
|
||||
key: 'dd_mm_yyyy'
|
||||
}
|
||||
};
|
||||
|
||||
const allShortDateFormatArray = [
|
||||
allShortDateFormat.YYYYMMDD,
|
||||
allShortDateFormat.MMDDYYYY,
|
||||
allShortDateFormat.DDMMYYYY
|
||||
];
|
||||
|
||||
const allLongTimeFormat = {
|
||||
HHMMSS: {
|
||||
type: 1,
|
||||
key: 'hh_mm_ss',
|
||||
is24HourFormat: true
|
||||
},
|
||||
AHHMMSS: {
|
||||
type: 2,
|
||||
key: 'a_hh_mm_ss',
|
||||
is24HourFormat: false
|
||||
},
|
||||
HHMMSSA: {
|
||||
type: 3,
|
||||
key: 'hh_mm_ss_a',
|
||||
is24HourFormat: false
|
||||
}
|
||||
};
|
||||
|
||||
const allLongTimeFormatArray = [
|
||||
allLongTimeFormat.HHMMSS,
|
||||
allLongTimeFormat.AHHMMSS,
|
||||
allLongTimeFormat.HHMMSSA
|
||||
];
|
||||
|
||||
const allShortTimeFormat = {
|
||||
HHMM: {
|
||||
type: 1,
|
||||
key: 'hh_mm',
|
||||
is24HourFormat: true
|
||||
},
|
||||
AHHMM: {
|
||||
type: 2,
|
||||
key: 'a_hh_mm',
|
||||
is24HourFormat: false
|
||||
},
|
||||
HHMMA: {
|
||||
type: 3,
|
||||
key: 'hh_mm_a',
|
||||
is24HourFormat: false
|
||||
}
|
||||
};
|
||||
|
||||
const allShortTimeFormatArray = [
|
||||
allShortTimeFormat.HHMM,
|
||||
allShortTimeFormat.AHHMM,
|
||||
allShortTimeFormat.HHMMA
|
||||
];
|
||||
|
||||
const allDateRanges = {
|
||||
All: {
|
||||
type: 0,
|
||||
@@ -91,10 +181,28 @@ const allDateRanges = {
|
||||
};
|
||||
|
||||
const defaultFirstDayOfWeek = allWeekDays.Sunday.type;
|
||||
const defaultLongDateFormat = allLongDateFormat.YYYYMMDD;
|
||||
const defaultShortDateFormat = allShortDateFormat.YYYYMMDD;
|
||||
const defaultLongTimeFormat = allLongTimeFormat.HHMMSS;
|
||||
const defaultShortTimeFormat = allShortTimeFormat.HHMM;
|
||||
const defaultDateTimeFormatValue = 0;
|
||||
|
||||
export default {
|
||||
allWeekDays: allWeekDays,
|
||||
allWeekDaysArray: allWeekDaysArray,
|
||||
allLongDateFormat: allLongDateFormat,
|
||||
allLongDateFormatArray: allLongDateFormatArray,
|
||||
allShortDateFormat: allShortDateFormat,
|
||||
allShortDateFormatArray: allShortDateFormatArray,
|
||||
allLongTimeFormat: allLongTimeFormat,
|
||||
allLongTimeFormatArray: allLongTimeFormatArray,
|
||||
allShortTimeFormat: allShortTimeFormat,
|
||||
allShortTimeFormatArray: allShortTimeFormatArray,
|
||||
allDateRanges: allDateRanges,
|
||||
defaultFirstDayOfWeek: defaultFirstDayOfWeek
|
||||
defaultFirstDayOfWeek: defaultFirstDayOfWeek,
|
||||
defaultLongDateFormat: defaultLongDateFormat,
|
||||
defaultShortDateFormat: defaultShortDateFormat,
|
||||
defaultLongTimeFormat: defaultLongTimeFormat,
|
||||
defaultShortTimeFormat: defaultShortTimeFormat,
|
||||
defaultDateTimeFormatValue: defaultDateTimeFormatValue,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user