From 0c8d9eacd3f81649573fe0da8efc4efe0f2a4597 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Wed, 29 Jul 2020 23:25:52 -0700 Subject: [PATCH] Change date filter format. --- components/DateFilter.js | 6 +++--- components/PageviewsChart.js | 5 +++-- components/WebsiteList.js | 24 ++++++++++++------------ components/WebsiteList.module.css | 3 +++ components/WebsiteStats.js | 6 ++++-- components/WebsiteStats.module.css | 10 ++++++++++ lib/date.js | 22 +++++++++------------- 7 files changed, 44 insertions(+), 32 deletions(-) create mode 100644 components/WebsiteList.module.css create mode 100644 components/WebsiteStats.module.css diff --git a/components/DateFilter.js b/components/DateFilter.js index 586044b0..b2540c6a 100644 --- a/components/DateFilter.js +++ b/components/DateFilter.js @@ -1,10 +1,10 @@ import React, { useState } from 'react'; import { getDateRange } from 'lib/date'; -const filterOptions = ['24h', '7d', '30d']; +const filterOptions = ['24hour', '7day', '30day', '60day', '90day']; export default function DateFilter({ onChange }) { - const [selected, setSelected] = useState('7d'); + const [selected, setSelected] = useState('7day'); function handleChange(e) { const value = e.target.value; @@ -15,7 +15,7 @@ export default function DateFilter({ onChange }) { return (