Fix date formatting in system graphs
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
|
||||
<script setup>
|
||||
|
||||
import moment from 'moment-timezone';
|
||||
import { onMounted, onUnmounted, useTemplateRef, watch } from 'vue';
|
||||
import Chart from 'chart.js/auto';
|
||||
import { prettyDecimalSize, formatDate } from '@cloudron/pankow/utils';
|
||||
@@ -144,7 +143,7 @@ function createGraphOptions({ yscale, period, highMark }) {
|
||||
maxRotation: 0, // don't rotate the labels
|
||||
callback: function (value) {
|
||||
if (period.hours === 0) return `${5-(value-this.min)/60000}min`;
|
||||
return moment(value).format(period.tickFormat);
|
||||
return formatDate(period.tickFormat, value);
|
||||
},
|
||||
count, // ignored when stepSize is set
|
||||
stepSize // for realtime graph, generate steps of 1min and appropriate tick text
|
||||
|
||||
Reference in New Issue
Block a user