Skip to content

Commit 6eaaec4

Browse files
committed
feat(Calendar): Add start and end time to tooltips
1 parent f7fe244 commit 6eaaec4

3 files changed

Lines changed: 20 additions & 16 deletions

File tree

src/app/routes/calendar/calendar-route.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ const TimeEntryBox = ({
9494

9595
const height = pxToRem(getYPos(endH).px - getYPos(startH).px)
9696
const showCategory = height >= 2
97+
const duration = (
98+
timeHelpers.getDuration(entry.start, entry.end) / 60
99+
).toLocaleString(getLocale(), {
100+
maximumFractionDigits: 2,
101+
})
97102
return (
98103
<div
99104
className={cn(
@@ -114,15 +119,20 @@ const TimeEntryBox = ({
114119

115120
<CursorTooltip trigger={<span className="absolute inset-0" />}>
116121
<div className="max-w-48">
117-
<div className="truncate text-xs font-bold">
122+
<span className="text-xs font-bold">
123+
{entry.start} –⁠ {entry.end}{" "}
124+
<span className="text-text-gentle">({duration}h)</span>
125+
</span>
126+
127+
<div className="truncate text-sm font-bold">
118128
{category?.fullName || t`No category`}
119129
</div>
120130

121131
{entry.description ? (
122132
<div>{entry.description}</div>
123133
) : (
124134
<div className="text-text-gentle">
125-
<Trans>No descirption</Trans>
135+
<Trans>No description</Trans>
126136
</div>
127137
)}
128138
</div>

src/locales/de/messages.po

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,8 @@ msgstr "Nächstes Jahr"
586586
msgid "No categories found"
587587
msgstr "Keine Kategorien gefunden"
588588

589-
#: src/app/routes/calendar/calendar-route.tsx:111
590-
#: src/app/routes/calendar/calendar-route.tsx:118
589+
#: src/app/routes/calendar/calendar-route.tsx:116
590+
#: src/app/routes/calendar/calendar-route.tsx:128
591591
#: src/app/routes/search/search-route.tsx:30
592592
#: src/app/routes/stats/categories-chart.tsx:41
593593
#: src/features/components/category-name.tsx:66
@@ -599,16 +599,13 @@ msgstr "Keine Kategorie"
599599
msgid "No column"
600600
msgstr "Keine Spalte"
601601

602-
#: src/app/routes/calendar/calendar-route.tsx:125
603-
msgid "No descirption"
604-
msgstr "Keine Beschreibung"
605-
602+
#: src/app/routes/calendar/calendar-route.tsx:135
606603
#: src/features/time-table/time-summary.tsx:84
607604
#: src/features/time-table/time-summary.tsx:119
608605
msgid "No description"
609606
msgstr "Keine Beschreibung"
610607

611-
#: src/app/routes/calendar/calendar-route.tsx:152
608+
#: src/app/routes/calendar/calendar-route.tsx:162
612609
msgid "No entries"
613610
msgstr "Keine Einträge"
614611

src/locales/en/messages.po

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,8 @@ msgstr "Next year"
588588
msgid "No categories found"
589589
msgstr "No categories found"
590590

591-
#: src/app/routes/calendar/calendar-route.tsx:111
592-
#: src/app/routes/calendar/calendar-route.tsx:118
591+
#: src/app/routes/calendar/calendar-route.tsx:116
592+
#: src/app/routes/calendar/calendar-route.tsx:128
593593
#: src/app/routes/search/search-route.tsx:30
594594
#: src/app/routes/stats/categories-chart.tsx:41
595595
#: src/features/components/category-name.tsx:66
@@ -601,16 +601,13 @@ msgstr "No category"
601601
msgid "No column"
602602
msgstr "No column"
603603

604-
#: src/app/routes/calendar/calendar-route.tsx:125
605-
msgid "No descirption"
606-
msgstr "No descirption"
607-
604+
#: src/app/routes/calendar/calendar-route.tsx:135
608605
#: src/features/time-table/time-summary.tsx:84
609606
#: src/features/time-table/time-summary.tsx:119
610607
msgid "No description"
611608
msgstr "No description"
612609

613-
#: src/app/routes/calendar/calendar-route.tsx:152
610+
#: src/app/routes/calendar/calendar-route.tsx:162
614611
msgid "No entries"
615612
msgstr "No entries"
616613

0 commit comments

Comments
 (0)