mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Auth and session middleware.
This commit is contained in:
parent
590a70c2ff
commit
d81ee3932d
14 changed files with 142 additions and 73 deletions
11
lib/date.js
Normal file
11
lib/date.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import moment from 'moment-timezone';
|
||||
import { addMinutes } from 'date-fns';
|
||||
|
||||
export function getTimezone() {
|
||||
const tz = moment.tz.guess();
|
||||
return moment.tz.zone(tz).abbr(new Date().getTimezoneOffset());
|
||||
}
|
||||
|
||||
export function getLocalTime(t) {
|
||||
return addMinutes(new Date(t), new Date().getTimezoneOffset());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue