@@ -27,7 +27,8 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com
2727import { SegmentedControl , SegmentedControlItem } from "@/components/ui/segmented-control" ;
2828import { Sheet , SheetContent , SheetHeader , SheetTitle , SheetTrigger } from "@/components/ui/sheet" ;
2929import type { BoardMode } from "@/components/event-heatmap" ;
30- import { minutesToLabel } from "@/lib/availability" ;
30+ import { formatFullDayDateLabel , minutesToLabel } from "@/lib/availability" ;
31+ import type { AppLocale } from "@/lib/i18n/locale" ;
3132import { useI18n } from "@/lib/i18n/context" ;
3233import type { PublicEventSnapshot , SnapshotParticipant , SnapshotSlot } from "@/lib/types" ;
3334import { cn } from "@/lib/utils" ;
@@ -181,12 +182,13 @@ function getDisabledDayStyle(): CSSProperties {
181182 } ;
182183}
183184
184- function getDayLabel ( snapshot : PublicEventSnapshot , slot : SnapshotSlot ) {
185- const dateLabel = snapshot . dates . find ( ( date ) => date . dateKey === slot . dateKey ) ?. label ?? slot . dateKey ;
186-
187- return snapshot . fullDayStartMinutes === null || snapshot . fullDayStartMinutes === undefined
188- ? dateLabel
189- : `${ dateLabel } · ${ minutesToLabel ( snapshot . fullDayStartMinutes ) } ` ;
185+ function getDayLabel ( snapshot : PublicEventSnapshot , slot : SnapshotSlot , locale : AppLocale ) {
186+ return formatFullDayDateLabel ( {
187+ dateKey : slot . dateKey ,
188+ fullDayStartMinutes : snapshot . fullDayStartMinutes ,
189+ timezone : snapshot . timezone ,
190+ locale,
191+ } ) ;
190192}
191193
192194function getDayElementFromPoint ( clientX : number , clientY : number ) {
@@ -273,7 +275,7 @@ export function FullDayAvailability({
273275 onActiveParticipantChange,
274276 description,
275277} : FullDayAvailabilityProps ) {
276- const { messages, format, plural, intlLocale } = useI18n ( ) ;
278+ const { messages, format, plural, intlLocale, locale } = useI18n ( ) ;
277279 const [ activeSlotStart , setActiveSlotStart ] = useState < string | null > ( null ) ;
278280 const [ internalActiveParticipantId , setInternalActiveParticipantId ] = useState < string | null > (
279281 null ,
@@ -348,7 +350,7 @@ export function FullDayAvailability({
348350 const activeSlotDetails = activeSlot
349351 ? {
350352 slot : activeSlot ,
351- dateLabel : getDayLabel ( snapshot , activeSlot ) ,
353+ dateLabel : getDayLabel ( snapshot , activeSlot , locale ) ,
352354 availableParticipants : snapshot . participants . filter ( ( participant ) =>
353355 activeSlot . participantIds . includes ( participant . id ) ,
354356 ) ,
@@ -377,7 +379,7 @@ export function FullDayAvailability({
377379 } , [ ] ) ;
378380
379381 function getAvailabilityTitle ( slot : SnapshotSlot ) {
380- const dateLabel = getDayLabel ( snapshot , slot ) ;
382+ const dateLabel = getDayLabel ( snapshot , slot , locale ) ;
381383 const availableNames = slot . participantIds
382384 . map ( ( participantId ) => participantNamesById . get ( participantId ) )
383385 . filter ( Boolean ) as string [ ] ;
0 commit comments