Skip to content

Commit

Permalink
add forcehover
Browse files Browse the repository at this point in the history
  • Loading branch information
vassbence committed Oct 18, 2024
1 parent 1d48119 commit 1e33633
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/components/Calendar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -571,13 +571,15 @@ function CalendarControls({
}}
/>
<CalendarDropdown value={value} onChange={onChange} variant="date">
<Button variant="ghost">
{variant === 'monthly' && format(value, 'MMMM yyyy')}
{variant === '2-weekly' &&
`${format(startOfWeek(value, { weekStartsOn: 1 }), 'MMM d yyyy')} - ${format(addDays(startOfWeek(value, { weekStartsOn: 1 }), 13), 'MMM d yyyy')}`}
{variant === 'weekly' &&
`${format(startOfWeek(value, { weekStartsOn: 1 }), 'MMM d yyyy')} - ${format(addDays(startOfWeek(value, { weekStartsOn: 1 }), 6), 'MMM d yyyy')}`}
</Button>
{({ open }) => (
<Button variant="ghost" forceHover={open}>
{variant === 'monthly' && format(value, 'MMMM yyyy')}
{variant === '2-weekly' &&
`${format(startOfWeek(value, { weekStartsOn: 1 }), 'MMM d yyyy')} - ${format(addDays(startOfWeek(value, { weekStartsOn: 1 }), 13), 'MMM d yyyy')}`}
{variant === 'weekly' &&
`${format(startOfWeek(value, { weekStartsOn: 1 }), 'MMM d yyyy')} - ${format(addDays(startOfWeek(value, { weekStartsOn: 1 }), 6), 'MMM d yyyy')}`}
</Button>
)}
</CalendarDropdown>
<IconButton
icon="arrow-right"
Expand Down

0 comments on commit 1e33633

Please sign in to comment.