diff --git a/utils/formatGraphForPatients.ts b/utils/formatGraphForPatients.ts index 75962de67b037..ee052a534fe04 100644 --- a/utils/formatGraphForPatients.ts +++ b/utils/formatGraphForPatients.ts @@ -17,16 +17,22 @@ export type GraphDataType = { export default (data: DataType[]) => { const graphData: GraphDataType[] = [] const today = new Date() + // temporary fix + const yesterday = new Date( + today.getFullYear(), + today.getMonth(), + today.getDate() + ) let patSum = 0 data - .filter(d => new Date(d['日付']) < today) + .filter(d => new Date(d['日付']) < yesterday) .forEach(d => { const date = new Date(d['日付']) const subTotal = d['小計'] if (!isNaN(subTotal)) { patSum += subTotal graphData.push({ - label: `${date.getMonth() + 1}/${date.getDate() - 1}`, + label: `${date.getMonth() + 1}/${date.getDate()}`, transition: subTotal, cumulative: patSum })