DropDown component. Renamed files.

This commit is contained in:
Mike Cao 2020-07-30 20:11:43 -07:00
parent ff4492ffb5
commit 9f112c8cc9
16 changed files with 149 additions and 48 deletions

View file

@ -2,13 +2,13 @@ import moment from 'moment-timezone';
import {
addMinutes,
addHours,
addDays,
subHours,
subDays,
startOfHour,
startOfDay,
endOfHour,
endOfDay,
startOfHour,
addDays,
subDays,
subHours,
differenceInHours,
differenceInDays,
} from 'date-fns';
@ -17,10 +17,6 @@ export function getTimezone() {
return moment.tz.guess();
}
export function getTimezonAbbr() {
return moment.tz.zone(getTimezone()).abbr(new Date().getTimezoneOffset());
}
export function getLocalTime(t) {
return addMinutes(new Date(t), new Date().getTimezoneOffset());
}
@ -38,12 +34,14 @@ export function getDateRange(value) {
startDate: subDays(day, num),
endDate: day,
unit,
value,
};
case 'hour':
return {
startDate: subHours(hour, num),
endDate: hour,
unit,
value,
};
}
}

View file

@ -180,7 +180,7 @@ export async function getPageviewData(
);
}
export async function getSummary(website_id, start_at, end_at) {
export async function getMetrics(website_id, start_at, end_at) {
return runQuery(
prisma.queryRaw(
`