Fix chart tooltip date format.

This commit is contained in:
Orne Brocaar 2022-09-13 10:15:21 +01:00
parent 331f4bce40
commit a43ef72fb2
2 changed files with 5 additions and 1 deletions

View File

@ -17,10 +17,13 @@ interface IProps {
class MetricChart extends Component<IProps> {
render() {
let unit: TimeUnit = "hour";
let tooltipFormat = "LT";
if (this.props.aggregation === Aggregation.DAY) {
unit = "day";
tooltipFormat = "MMM Do";
} else if (this.props.aggregation === Aggregation.MONTH) {
unit = "month";
tooltipFormat = "MMM YYYY";
}
const animation: false = false;
@ -41,6 +44,7 @@ class MetricChart extends Component<IProps> {
type: "time" as const,
time: {
unit: unit,
tooltipFormat: tooltipFormat,
},
},
},

View File

@ -1881,7 +1881,7 @@
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@chirpstack/chirpstack-api-grpc-web@file:../api/grpc-web":
version "4.0.0-rc.3"
version "4.0.0-rc.4"
dependencies:
"@types/google-protobuf" "^3.15.2"
google-protobuf "^3.17.3"