Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix san mateo data #791

Merged
merged 2 commits into from
Jan 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions utils/formatGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ type GraphDataType = {

export default (data: DataType[]) => {
const graphData: GraphDataType[] = []
const today = new Date()
const lastMonth = new Date()
lastMonth.setMonth(today.getMonth() - 3)
const lastMonth = new Date('2020-01-23')
kengoy marked this conversation as resolved.
Show resolved Hide resolved
let subTotal = 0
let previousDayCases = 0
let deathSubTotal = 0
let deathPreviousDayCases = 0
let cases = 0
let deaths = 0
data
.filter(d => new Date(d.date) > lastMonth)
.forEach((d, idx, array) => {
const date = new Date(d.date)
const cases = d.cases
const deaths = d.deaths
cases = d.cases || cases
deaths = d.deaths || deaths
if (!isNaN(cases)) {
if (cases === 0) {
return
Expand Down