Update time display to show fractions of days

Modify cell display and popover options to show day fractions instead of hours when in days mode, using French locale formatting.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 55837015-10e9-4be9-b857-7f5e6be73772
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: d7c2088e-0745-44c4-a970-ccf04e97a2dc
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1cc377db-7ea0-49f2-97ce-c3e87e0228cc/55837015-10e9-4be9-b857-7f5e6be73772/rbDY67j
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
SylvainP1 2026-04-24 09:17:11 +00:00
parent 2099b72df7
commit be98b67ec1
3 changed files with 15 additions and 2 deletions

View File

@ -528,9 +528,15 @@ export default function TimesheetDetailPage() {
const val = localEntries[key] || 0;
const desc = localDescriptions[key] || "";
const cellDisplay = val === 0
? ""
: showDays
? (val / 8).toLocaleString("fr-FR")
: val;
const cellContent = (
<div className="relative flex items-center justify-center h-9 w-full text-xs">
{val === 0 ? "" : val}
{cellDisplay}
{desc && (
<span className="absolute top-0.5 right-0.5 h-1.5 w-1.5 rounded-full bg-amber-400" />
)}
@ -554,6 +560,9 @@ export default function TimesheetDetailPage() {
{cellContent}
</PopoverTrigger>
<PopoverContent className="w-56 p-2 space-y-2" side="bottom" align="center">
<div className="text-[10px] font-semibold text-muted-foreground uppercase tracking-wide pb-1">
{showDays ? "Jour" : "Heures"}
</div>
<div className="grid grid-cols-5 gap-1">
{HOUR_OPTIONS.map(h => (
<button
@ -568,7 +577,11 @@ export default function TimesheetDetailPage() {
: "bg-muted/50 hover:bg-primary/10"
)}
>
{h === 0 ? "✕" : `${h}h`}
{h === 0
? "✕"
: showDays
? (h / 8).toLocaleString("fr-FR", { minimumFractionDigits: 3, maximumFractionDigits: 3 })
: `${h}h`}
</button>
))}
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB