Skip to content

Commit

Permalink
take time format from settings on mount
Browse files Browse the repository at this point in the history
  • Loading branch information
Z1xus committed Dec 5, 2024
1 parent aced887 commit 55540f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "dht22-webui"
version = "1.0.0"
version = "1.0.1"
description = "DHT22 Sensor monitoring system"
readme = "README.md"
requires-python = ">=3.12"
Expand Down
12 changes: 6 additions & 6 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ <h2>Historical Data</h2>
day: 'numeric',
hour: settings.timeFormat === '24h' ? '2-digit' : 'numeric',
minute: '2-digit',
hour12: settings.timeFormat === '12h'
hour12: settings.timeFormat !== '24h'
});
};
});
Expand Down Expand Up @@ -668,9 +668,9 @@ <h2>Historical Data</h2>
return date.toLocaleString('en-US', {
month: 'short',
day: 'numeric',
hour: 'numeric',
hour: settings.timeFormat === '24h' ? '2-digit' : 'numeric',
minute: '2-digit',
hour12: true
hour12: settings.timeFormat !== '24h'
});
},
label: function (context) {
Expand All @@ -689,12 +689,12 @@ <h2>Historical Data</h2>
time: {
unit: 'minute',
displayFormats: {
minute: 'HH:mm',
hour: 'HH:mm',
minute: settings.timeFormat === '24h' ? 'HH:mm' : 'hh:mm a',
hour: settings.timeFormat === '24h' ? 'HH:mm' : 'hh:mm a',
day: 'MMM D',
month: 'MMM YYYY'
},
tooltipFormat: 'MMM D, HH:mm'
tooltipFormat: settings.timeFormat === '24h' ? 'MMM D, HH:mm' : 'MMM D, hh:mm a'
},
grid: {
display: false
Expand Down

0 comments on commit 55540f1

Please sign in to comment.