fix(migration): parsing and passing date

This commit is contained in:
poeti8 2019-10-24 18:36:01 +03:30
parent d53f28f56b
commit 684d833a31
1 changed files with 3 additions and 1 deletions

View File

@ -72,7 +72,9 @@ const postgres = knex({
stats.forEach(([b, o, country, referrer, date]) => {
if (b && o && country && referrer && date) {
const dateHour = startOfHour(date).toISOString();
const dateHour = startOfHour(
new Date(date)
).toISOString();
const browser = b.toLowerCase();
const os = o === "Mac Os X" ? "macos" : o.toLowerCase();
visits[dateHour] = {