Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions app/ui/lib/CalendarCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ export interface CalendarCellProps {
date: CalendarDate
}

function isRangeState(
state: CalendarState | RangeCalendarState
): state is RangeCalendarState {
return 'highlightedRange' in state
}

export function CalendarCell({ state, date }: CalendarCellProps) {
const ref = useRef<HTMLDivElement>(null)
const {
Expand All @@ -36,12 +42,14 @@ export function CalendarCell({ state, date }: CalendarCellProps) {

// The start and end date of the selected range will have
// an emphasized appearance.
const isSelectionStart = (state as RangeCalendarState).highlightedRange
? isSameDay(date, (state as RangeCalendarState).highlightedRange.start)
: isSelected
const isSelectionEnd = (state as RangeCalendarState).highlightedRange
? isSameDay(date, (state as RangeCalendarState).highlightedRange.end)
: isSelected
const isSelectionStart =
isRangeState(state) && state.highlightedRange
? isSameDay(date, state.highlightedRange.start)
: isSelected
const isSelectionEnd =
isRangeState(state) && state.highlightedRange
? isSameDay(date, state.highlightedRange.end)
: isSelected

// We add rounded corners on the left for the first day of the month,
// the first day of each week, and the start date of the selection.
Expand Down
2 changes: 1 addition & 1 deletion mockServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* - Please do NOT serve this file on production.
*/

const PACKAGE_VERSION = '2.4.5'
const PACKAGE_VERSION = '2.4.7'
const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423'
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
const activeClientIds = new Set()
Expand Down
Loading