Skip to content

Commit

Permalink
add selected helpers to range calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
TGlide committed Jun 26, 2024
1 parent 42e2dd4 commit cf20fc7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/smooth-cooks-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 1,5 @@
---
'@melt-ui/svelte': minor
---

add selection helpers to range calendar
12 changes: 11 additions & 1 deletion src/docs/data/builders/range-calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 221,20 @@ const builder = builderSchema(BUILDER_NAME, {
type: 'Readable<(date: DateValue) => boolean>',
},
{
name: 'isDateSelected',
name: 'isSelected',
description: 'A function that returns whether the given date is selected.',
type: 'Readable<(date: DateValue) => boolean>',
},
{
name: 'isSeletionStart',
description:
'A function that returns whether the given date is the date at the start of the selection range.',
},
{
name: 'isSeletionEnd',
description:
'A function that returns whether the given date is the date at the end of the selection range.',
},
],
});

Expand Down
3 changes: 3 additions & 0 deletions src/lib/builders/range-calendar/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 1096,9 @@ export function createRangeCalendar<T extends DateValue = DateValue>(
setMonth,
isDateDisabled: _isDateDisabled,
isDateUnavailable,
isSelectionStart,
isSelectionEnd,
isSelected
},
options,
ids,
Expand Down

0 comments on commit cf20fc7

Please sign in to comment.