diff --git a/src/components/Datetime.vue b/src/components/Datetime.vue index 0d4e182cd..7e64b85fe 100644 --- a/src/components/Datetime.vue +++ b/src/components/Datetime.vue @@ -15,6 +15,10 @@ export default { type: Boolean, default: false, }, + use12HourTimeFormat: { + type: Boolean, + default: false + }, }, computed: { @@ -22,7 +26,7 @@ export default { if (this.dateOnly) { return this.$root.date(this.value); } else { - return this.$root.datetime(this.value); + return this.$root.datetime(this.value, this.use12HourTimeFormat); } }, }, diff --git a/src/components/PingChart.vue b/src/components/PingChart.vue index 60b0d3c9c..faa01d1b2 100644 --- a/src/components/PingChart.vue +++ b/src/components/PingChart.vue @@ -40,6 +40,10 @@ export default { type: Number, required: true, }, + use12HourTimeFormat: { + type: Boolean, + default: false + } }, data() { return { @@ -64,6 +68,13 @@ export default { }, computed: { chartOptions() { + const hourTimeFormat = this.use12HourTimeFormat ? "hh" : "HH"; + const minuteTimeFormat = `${hourTimeFormat}:mm${ + this.use12HourTimeFormat ? " A" : "" + }`; + const tooltipFormat = `YYYY-MM-DD ${hourTimeFormat}:mm:ss${ + this.use12HourTimeFormat ? " A" : "" + }`; return { responsive: true, maintainAspectRatio: false, @@ -101,10 +112,10 @@ export default { time: { minUnit: "minute", round: "second", - tooltipFormat: "YYYY-MM-DD HH:mm:ss", + tooltipFormat, displayFormats: { - minute: "HH:mm", - hour: "MM-DD HH:mm", + minute: minuteTimeFormat, + hour: `MM-DD ${minuteTimeFormat}`, } }, ticks: { diff --git a/src/components/settings/General.vue b/src/components/settings/General.vue index 487c3ba3a..41f4e8729 100644 --- a/src/components/settings/General.vue +++ b/src/components/settings/General.vue @@ -37,6 +37,42 @@ + +
+ + +
+ + +
+
+ + +
+
+