Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Fine, use a string instead of date object

Gabe Kangasb89cc6fb2671
diff --git a/web/pages/components/chart.tsx b/web/pages/components/chart.tsx
index 3efae8ecc8..019411d1f1 100644
--- a/web/pages/components/chart.tsx
+++ b/web/pages/components/chart.tsx
@@ -1,6 +1,7 @@
import { LineChart } from 'react-chartkick'
import styles from '../../styles/styles.module.scss';
import 'chart.js';
+import format from 'date-fns/format'
interface TimedValue {
time: Date;
@@ -19,7 +20,8 @@ function createGraphDataset(dataArray) {
const dataValues = {};
dataArray.forEach(item => {
const dateObject = new Date(item.time);
- dataValues[dateObject] = item.value;
+ const dateString = format(dateObject, 'p P');
+ dataValues[dateString] = item.value;
})
return dataValues;
}