Fix the tooltips
All checks were successful
Build and Publish Docker Container / build (push) Successful in 3m12s
All checks were successful
Build and Publish Docker Container / build (push) Successful in 3m12s
This commit is contained in:
parent
44184095b8
commit
fb9547991c
@ -11,7 +11,7 @@ import './calendar-styles.css'
|
|||||||
import { Tooltip } from 'react-tooltip';
|
import { Tooltip } from 'react-tooltip';
|
||||||
|
|
||||||
const initialDate = dFns.parseISO('2023-12-15T00:00:00.000Z')
|
const initialDate = dFns.parseISO('2023-12-15T00:00:00.000Z')
|
||||||
const endDate = dFns.parseISO('2024-01-20T00:00:00.000Z')
|
const endDate = dFns.parseISO('2024-01-25T00:00:00.000Z')
|
||||||
const projectIds = [
|
const projectIds = [
|
||||||
195482340,
|
195482340,
|
||||||
195519024,
|
195519024,
|
||||||
@ -58,6 +58,19 @@ function useCalendarData() {
|
|||||||
return R.sum((entries ?? []).map((entry) => entry.raw_json.seconds))
|
return R.sum((entries ?? []).map((entry) => entry.raw_json.seconds))
|
||||||
}, grouped);
|
}, grouped);
|
||||||
|
|
||||||
|
// Fill in missing days, hacky
|
||||||
|
dFns.eachDayOfInterval({
|
||||||
|
start: initialDate,
|
||||||
|
end: endDate,
|
||||||
|
}).forEach((date) => {
|
||||||
|
const key = dFns.formatISO(date);
|
||||||
|
if (summed[key] == undefined) {
|
||||||
|
summed[key] = 0;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
debugger
|
||||||
|
|
||||||
setData(Object.entries(summed)
|
setData(Object.entries(summed)
|
||||||
.map(([key, value]) => ({
|
.map(([key, value]) => ({
|
||||||
date: dFns.parseISO(key),
|
date: dFns.parseISO(key),
|
||||||
@ -81,10 +94,10 @@ export function CalendarOverviewCard() {
|
|||||||
values={data}
|
values={data}
|
||||||
classForValue={value => `color-github-${computeCompletionShade(value?.count ?? 0)}`}
|
classForValue={value => `color-github-${computeCompletionShade(value?.count ?? 0)}`}
|
||||||
tooltipDataAttrs={(value: any) => {
|
tooltipDataAttrs={(value: any) => {
|
||||||
return {
|
return value.date ? {
|
||||||
'data-tooltip-id': `calendar-tooltip`,
|
'data-tooltip-id': `calendar-tooltip`,
|
||||||
'data-tooltip-content': value.count ?`${dFns.format(value.date, 'EEE do: ')} ${value.count.toFixed(2)} hours` : `${dFns.format(value.date, 'EEE do: ')} No time logged`
|
'data-tooltip-content': value.count ?`${dFns.format(value.date, 'EEE do')}: ${value.count.toFixed(2)} hours` : `${dFns.format(value.date, 'EEE do')}`
|
||||||
}
|
} : undefined
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user