mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
Fine, use a string instead of date object
This commit is contained in:
parent
59eb6eaa16
commit
b89cc6fb26
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user