Fix bug when converting date timestamp to date object. Updated the createdAt type.
This commit is contained in:
@@ -8,10 +8,8 @@ const lineChartArr = (dailyStatsArr: DailyStats): LineChartArr => {
|
||||
dailyStatsArr.forEach((item) => {
|
||||
const { linksDeleted, commandResponses, timesTriggered, createdAt } =
|
||||
item;
|
||||
const day =
|
||||
typeof createdAt === "number"
|
||||
? new Date(createdAt * 1000).getDate()
|
||||
: new Date().getDate();
|
||||
|
||||
const day = new Date(Number(createdAt)).getDate();
|
||||
|
||||
const lineChartItem: LineChartItem = {
|
||||
day,
|
||||
|
||||
Reference in New Issue
Block a user