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

View File

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