Skip to content
This repository has been archived by the owner on Feb 19, 2023. It is now read-only.

Commit

Permalink
RangeError: Invalid time value
Browse files Browse the repository at this point in the history
  • Loading branch information
Vacilando authored and conradj committed Dec 2, 2021
1 parent ce83e38 commit bac12ca
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ exports.sourceNodes = async (

const tags = datum.tags ? Object.keys(datum.tags) : [];

const readDay = datum.time_read ? parseInt(format(startOfDay(new Date(parseInt(datum.time_read) * 1000)), "X")) : 0

const readWeek = datum.time_read ? parseInt(format(startOfWeek(new Date(parseInt(datum.time_read) * 1000)), "X")) : 0

createNode({
id: createNodeId(`${POCKET_ARTICLE_NODE_TYPE}-${datum.item_id}`),
readDay: parseInt(
format(startOfDay(new Date(parseInt(datum.time_read) * 1000)), "X")
),
readWeek: parseInt(
format(startOfWeek(new Date(parseInt(datum.time_read) * 1000)), "X")
),
readDay: readDay,
readWeek: readWeek,
url: datum.resolved_url,
title: datum.resolved_title,
articleDomain: articleDomain,
Expand Down

0 comments on commit bac12ca

Please sign in to comment.