mirror of
https://github.com/gosticks/web.git
synced 2026-10-06 22:57:01 +00:00
Fix type errors in chart tooltip callbacks
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
@@ -52,7 +52,8 @@ class ClientsGraph extends Component<ClientsGraphProps & WithNamespaces, {}> {
|
||||
},
|
||||
callbacks: {
|
||||
title: tooltipItem => {
|
||||
const time = tooltipItem[0].xLabel!.match(/(\d?\d):?(\d?\d?)/);
|
||||
const timeStr = tooltipItem[0].xLabel! as string;
|
||||
const time = timeStr.match(/(\d?\d):?(\d?\d?)/);
|
||||
const hour = parseInt(time![1], 10);
|
||||
const minute = parseInt(time![2], 10) || 0;
|
||||
const from = padNumber(hour) + ":" + padNumber(minute - 5) + ":00";
|
||||
|
||||
@@ -70,7 +70,8 @@ class QueriesGraph extends Component<QueriesGraphProps & WithNamespaces, {}> {
|
||||
mode: "x-axis",
|
||||
callbacks: {
|
||||
title: tooltipItem => {
|
||||
const time = tooltipItem[0].xLabel!.match(/(\d?\d):?(\d?\d?)/);
|
||||
const timeStr = tooltipItem[0].xLabel! as string;
|
||||
const time = timeStr.match(/(\d?\d):?(\d?\d?)/);
|
||||
const hour = parseInt(time![1], 10);
|
||||
const minute = parseInt(time![2], 10) || 0;
|
||||
const from = padNumber(hour) + ":" + padNumber(minute - 5) + ":00";
|
||||
|
||||
Reference in New Issue
Block a user