Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
Safari can't parse date strings with - separator, hence using '/'
  • Loading branch information
vijaye-statsig authored Feb 28, 2022
1 parent a93169f commit 4edbee1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ function getStatusDescriptiveText(color) {
return color == "nodata"
? "No Data Available: Health check was not performed."
: color == "success"
? "No downtime recorded today."
? "No downtime recorded on this day."
: color == "failure"
? "Major outages recorded today."
? "Major outages recorded on this day."
: color == "partial"
? "Partial outages recorded today."
? "Partial outages recorded on this day."
: "Unknown";
}

Expand Down Expand Up @@ -183,7 +183,7 @@ function splitRowsByDate(rows) {
}

const [dateTimeStr, resultStr] = row.split(",", 2);
const dateTime = new Date(Date.parse(dateTimeStr + " GMT"));
const dateTime = new Date(Date.parse(dateTimeStr.replace(/-/g, "/") + " GMT"));
const dateStr = dateTime.toDateString();

let resultArray = dateValues[dateStr];
Expand Down

0 comments on commit 4edbee1

Please sign in to comment.