diff options
author | Galen Guyer <galen@galenguyer.com> | 2021-01-31 18:46:34 -0500 |
---|---|---|
committer | Galen Guyer <galen@galenguyer.com> | 2021-01-31 18:46:34 -0500 |
commit | ae53046ebb782b89919dc08d17fce7ad829a75c1 (patch) | |
tree | 3f2cfaa8f31ee9d056ebd4fb6536037325f0d28b | |
parent | a9a75bc2d0c6fa96cefa9ca0c4896082ad8e68dc (diff) |
Add two weeks ago option and show time diff
-rw-r--r-- | src/App.js | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -97,13 +97,14 @@ function App() { day: "2-digit", hour: "2-digit", minute: "2-digit", - })} + })}{" "} + ({timeDifference == 1 ? "one day ago" : timeDifference == 5 ? "one week ago" : "two weeks ago"}) </h4> <button - onClick={() => setTimeDifference(timeDifference == 1 ? 5 : 1)} + onClick={() => setTimeDifference(timeDifference == 1 ? 5 : timeDifference == 5 ? 10 : 1)} className="bg-transparent text-sm hover:bg-orange-400 text-gray-600 hover:text-white py-1 my-1 px-2 border border-orange-300 hover:border-transparent rounded transition ease-in-out duration-300" > - Use one {timeDifference == 1 ? "week" : "day"} ago + Use {timeDifference == 10 ? "one day" : timeDifference == 5 ? "two weeks" : "one week"} ago </button> <button |