Auth and session middleware.
This commit is contained in:
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());
|
||||
}
|
||||
Reference in New Issue
Block a user