Skip to content

Commit 68341f6

Browse files
authored
Merge branch 'main' into today
2 parents c9bdfb2 + ba1c2db commit 68341f6

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ Try it in the [Svelte REPL](https://svelte.dev/repl/cae0ce6e92634878b6e1a587146d
3030
const toggleDatePicker = () => (isOpen = !isOpen);
3131
3232
const formatDate = (dateString) => {
33+
if (isNaN(new Date(dateString))) {
34+
return '';
35+
}
36+
3337
return dateString && format(new Date(dateString), dateFormat) || '';
3438
};
3539
40+
3641
let formattedStartDate = formatDate(startDate);
3742
3843
const onChange = () => {

docs/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@svelte-plugins/datepicker",
33
"description": "A simple datepicker component designed for Svelte.",
4-
"version": "1.0.10",
4+
"version": "1.0.11",
55
"license": "MIT",
66
"author": "Kieran Boyle (https://github.com/dysfunc)",
77
"homepage": "https://github.com/svelte-plugins/datepicker",

src/datepicker.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ export interface DatePickerProps {
8080
*/
8181
enabledDates?: string[];
8282

83+
/**
84+
* Callback function to handle when the date change events.
85+
*/
86+
onDateChange?: (event: Object) => void;
87+
8388
/**
8489
* Callback function to handle day click events.
8590
*/
@@ -106,6 +111,11 @@ export interface DatePickerProps {
106111
*/
107112
showPresets?: boolean;
108113

114+
/**
115+
* Indicates whether preset options should only be shown for range pickers.
116+
*/
117+
showPresetsOnly?: boolean;
118+
109119
/**
110120
* Indicates whether the time picker is shown in the date picker.
111121
*/

0 commit comments

Comments
 (0)