Auth and session middleware.

This commit is contained in:
Mike Cao 2020-07-27 23:52:14 -07:00
parent 590a70c2ff
commit d81ee3932d
14 changed files with 142 additions and 73 deletions

11
lib/date.js Normal file
View 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());
}