Skip to content

Commit 58730d0

Browse files
committed
fix(timepicker): prevent date reset on timepicker clear
1 parent bff4dd8 commit 58730d0

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

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.5",
4+
"version": "1.0.6",
55
"license": "MIT",
66
"author": "Kieran Boyle (https://github.com/dysfunc)",
77
"homepage": "https://github.com/svelte-plugins/datepicker",

src/datepicker.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,10 +791,11 @@
791791
return date.getTime();
792792
}
793793
794-
const [hours, minutes] = (which === 'start' ? startDateTime : endDateTime).split(':');
794+
const [hours = 0, minutes = 0, seconds = 0] = (which === 'start' ? startDateTime : endDateTime).split(':');
795795
796796
date.setHours(hours);
797797
date.setMinutes(minutes);
798+
date.setSeconds(seconds);
798799
799800
return date.getTime();
800801
};

0 commit comments

Comments
 (0)