aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGalen Guyer <galen@galenguyer.com>2020-11-16 20:26:41 -0500
committerGalen Guyer <galen@galenguyer.com>2020-11-16 20:26:41 -0500
commit5f3c5c9a24f9b2f60284cee23ad6f9a1cc970eca (patch)
treeb76a9bf84f9a36376353a761acc285997be1c9f1
parent298b4827e484c38f6d9d464872220df041d9e756 (diff)
use nicer date format in graph tooltip
-rw-r--r--src/History.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/History.js b/src/History.js
index 30e2fc4..7425b61 100644
--- a/src/History.js
+++ b/src/History.js
@@ -68,8 +68,10 @@ class CustomizedAxisTick extends PureComponent {
const CustomTooltip = ({ active, payload, label }) => {
if (active) {
return (
- <div className="custom-tooltip bg-white border-orange-300 border-2 rounded-lg p-1">
- <p className="label">{DateTime.fromSeconds(label).toLocaleString()}</p>
+ <div className="custom-tooltip bg-white border-orange-300 border-2 rounded-lg p-2">
+ <p className="label">
+ {DateTime.fromSeconds(label).toLocaleString({ weekday: "long", month: "long", day: "2-digit" })}
+ </p>
<p className="desc">{payload[0].value}</p>
</div>
);