Skip to content

Commit

Permalink
added minValue range check for date-disable
Browse files Browse the repository at this point in the history
  • Loading branch information
kwongz committed Jan 7, 2025
1 parent 239ebcd commit 3ac4090
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
export { className as class };
export let maxValue = undefined;
export let minValue = undefined;
$: hideExtraDay =
date.year >= maxValue.year && date.month >= maxValue.month && date.day >= maxValue.day
(date.year >= maxValue.year && date.month >= maxValue.month && date.day >= maxValue.day) ||
(date.year <= minValue.year && date.month <= minValue.month && date.day < minValue.day)
? true
: false;
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
<RangeCalendar.GridRow class="w-full mt-2">
{#each weekDates as date}
<RangeCalendar.Cell {date}>
<RangeCalendar.Day {date} month={month.value} {maxValue} />
<RangeCalendar.Day {date} month={month.value} {maxValue} {minValue} />
</RangeCalendar.Cell>
{/each}
</RangeCalendar.GridRow>
Expand Down

0 comments on commit 3ac4090

Please sign in to comment.