mirror of
https://github.com/StefBuwalda/dashboard_test.git
synced 2025-11-02 04:39:58 +00:00
log.dateCreated didn't contain any UTC metadata so now log.dateCreatedUTC() return the datetime object with correct metadata
This commit is contained in:
@@ -22,12 +22,19 @@
|
||||
const data = {
|
||||
labels: chartDates,
|
||||
datasets: [{
|
||||
label: 'Example Data',
|
||||
label: 'Ping',
|
||||
data: {{ values }},
|
||||
}]
|
||||
};
|
||||
|
||||
const ctx = document.getElementById('myChart').getContext('2d');
|
||||
// Current time in UTC
|
||||
const nowUTC = new Date();
|
||||
|
||||
// One hour ago in UTC
|
||||
const oneDayAgoUTC = new Date(nowUTC.getTime() - 24 * 60 * 60 * 1000);
|
||||
const min = "{{ min }}"
|
||||
const max = "{{ max }}"
|
||||
new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: data,
|
||||
@@ -36,8 +43,14 @@
|
||||
x: {
|
||||
type: 'time', // Important for datetime axis
|
||||
time: {
|
||||
unit: 'day'
|
||||
}
|
||||
unit: 'hour',
|
||||
tooltipFormat: 'HH:mm:ss',
|
||||
displayFormats: {
|
||||
hour: 'HH:mm'
|
||||
}
|
||||
},
|
||||
min: min,
|
||||
max: max
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user