From 246e4d98daa7801f2e8f7d5325dfb036736fc9df Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Thu, 21 Jan 2021 13:14:19 -0500 Subject: [PATCH] Add docs --- .../LastUpdatedCell/LastUpdatedCell.md | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/components/LastUpdatedCell/LastUpdatedCell.md b/src/components/LastUpdatedCell/LastUpdatedCell.md index e69de29..a0b202e 100644 --- a/src/components/LastUpdatedCell/LastUpdatedCell.md +++ b/src/components/LastUpdatedCell/LastUpdatedCell.md @@ -0,0 +1,36 @@ +The LastUpdatedCell wraps an [ItemTableCell](/#/Components/ItemTableCell) and changes its background color based on the time passed to it to indicate how old an item is. + +## Default Usage +```jsx +import { Paper } from '@material-ui/core'; +import LastUpdatedCell from "./LastUpdatedCell"; + +let today = new Date(); +let threeDaysAgo = new Date().setDate(today.getDate() - 3); +let lastWeek = new Date().setDate(today.getDate() - 8); +let lastMonth = new Date().setDate(today.getDate() - 28); + + + { /* Today */ } + + { /* Three Days Ago */ } + + { /* Last Week */ } + + { /* Last Month */ } + + +``` + +```jsx static + + { /* Today */ } + + { /* Three Days Ago */ } + + { /* Last Week */ } + + { /* Last Month */ } + + +``` \ No newline at end of file