mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 16:07:33 +08:00
allow user to limit time scope for editing transaction
This commit is contained in:
@@ -42,6 +42,22 @@ function getTimezoneOffset(timezone) {
|
||||
}
|
||||
}
|
||||
|
||||
function getTimezoneOffsetMinutes(timezone) {
|
||||
const offset = getTimezoneOffset(timezone);
|
||||
|
||||
if (!offset) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const parts = offset.split(':');
|
||||
|
||||
if (parts.length !== 2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return parseInt(parts[0]) * 60 + parseInt(parts[1]);
|
||||
}
|
||||
|
||||
function getCurrentUnixTime() {
|
||||
return moment().unix();
|
||||
}
|
||||
@@ -571,6 +587,7 @@ export default {
|
||||
isNumber,
|
||||
isBoolean,
|
||||
getTimezoneOffset,
|
||||
getTimezoneOffsetMinutes,
|
||||
getCurrentUnixTime,
|
||||
parseDateFromUnixTime,
|
||||
formatUnixTime,
|
||||
|
||||
Reference in New Issue
Block a user