Skip to content

Commit 6c98ad4

Browse files
committed
refactor(presets): set start and end date time during preset selection
1 parent f57ce31 commit 6c98ad4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/datepicker.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,10 +786,15 @@
786786
* @param {number} preset.start - The start date of the preset range.
787787
* @param {number} preset.end - The end date of the preset range.
788788
*/
789-
const onPresetClick = ({ start, end }) => {
789+
const onPresetClick = ({ start, startTime, end, endTime }) => {
790790
startDate = start;
791791
endDate = end;
792792
793+
if (startTime && endTime) {
794+
startDateTime = startTime;
795+
endDateTime = endTime;
796+
}
797+
793798
if (isRange && startDate && endDate) {
794799
onDateChange({
795800
startDate,

0 commit comments

Comments
 (0)