2.2.1 - Misc improvements and cleanup
All checks were successful
Docker Deploy / build-and-push (push) Successful in 4m3s
All checks were successful
Docker Deploy / build-and-push (push) Successful in 4m3s
This commit is contained in:
@@ -58,9 +58,11 @@ const chartOptions: ChartOptions<"bar"> = {
|
||||
beginAtZero: true,
|
||||
ticks: {
|
||||
color: "#e2e8f0",
|
||||
callback: function (value: any) {
|
||||
const hours = Math.floor(value / 60);
|
||||
const mins = value % 60;
|
||||
callback: function (value: string | number) {
|
||||
const numValue =
|
||||
typeof value === "string" ? parseFloat(value) : value;
|
||||
const hours = Math.floor(numValue / 60);
|
||||
const mins = Math.round(numValue % 60);
|
||||
return hours > 0 ? `${hours}h ${mins}m` : `${mins}m`;
|
||||
},
|
||||
},
|
||||
@@ -83,8 +85,8 @@ const chartOptions: ChartOptions<"bar"> = {
|
||||
},
|
||||
tooltip: {
|
||||
callbacks: {
|
||||
label: function (context: any) {
|
||||
const minutes = Math.round(context.raw);
|
||||
label: function (context) {
|
||||
const minutes = Math.round(context.raw as number);
|
||||
const hours = Math.floor(minutes / 60);
|
||||
const mins = minutes % 60;
|
||||
return ` ${hours}h ${mins}m`;
|
||||
|
||||
Reference in New Issue
Block a user