mirror of
https://github.com/chirpstack/chirpstack.git
synced 2024-12-19 21:27:55 +00:00
ui: Fix tooltip date formatting.
With the migration from moment to date-fns (#460) some of the formatting strings were not updated accordingly. Fixes #503.
This commit is contained in:
parent
e63296573b
commit
d69a0eee75
@ -15,16 +15,16 @@ interface IProps {
|
||||
|
||||
function MetricChart(props: IProps) {
|
||||
let unit: TimeUnit = "hour";
|
||||
let tooltipFormat = "LT";
|
||||
let tooltipFormat = "p";
|
||||
if (props.aggregation === Aggregation.DAY) {
|
||||
unit = "day";
|
||||
tooltipFormat = "MMM Do";
|
||||
tooltipFormat = "MMM d";
|
||||
} else if (props.aggregation === Aggregation.MONTH) {
|
||||
unit = "month";
|
||||
tooltipFormat = "MMM YYYY";
|
||||
tooltipFormat = "MMM yyyy";
|
||||
} else if (props.aggregation === Aggregation.MINUTE) {
|
||||
unit = "minute";
|
||||
tooltipFormat = "LT";
|
||||
tooltipFormat = "p";
|
||||
}
|
||||
|
||||
const animation = false as const;
|
||||
@ -59,8 +59,6 @@ function MetricChart(props: IProps) {
|
||||
.sort((a, b) => a.getLabel().localeCompare(b.getLabel()))
|
||||
.map((v, i) => {
|
||||
const colors = palette("cb-Paired", props.metric.getDatasetsList().length).map((hex: string) => "#" + hex);
|
||||
console.log(v.getLabel());
|
||||
console.log(colors[i]);
|
||||
|
||||
return {
|
||||
label: v.getLabel(),
|
||||
|
Loading…
Reference in New Issue
Block a user