mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 07:27:33 +08:00
show time difference between the transaction timezone and the default timezone on the transaction edit/view page
This commit is contained in:
@@ -149,6 +149,16 @@ export function getUnixTimeAfterUnixTime(unixTime, amount, unit) {
|
||||
return moment.unix(unixTime).add(amount, unit).unix();
|
||||
}
|
||||
|
||||
export function getTimeDifferenceHoursAndMinutes(timeDifferenceInMinutes) {
|
||||
let offsetHours = parseInt(Math.abs(timeDifferenceInMinutes) / 60);
|
||||
let offsetMinutes = Math.abs(timeDifferenceInMinutes) - offsetHours * 60;
|
||||
|
||||
return {
|
||||
offsetHours: offsetHours,
|
||||
offsetMinutes: offsetMinutes,
|
||||
};
|
||||
}
|
||||
|
||||
export function getMinuteFirstUnixTime(date) {
|
||||
const datetime = moment(date);
|
||||
return datetime.set({ second: 0, millisecond: 0 }).unix();
|
||||
|
||||
Reference in New Issue
Block a user