From a0255b579cb3332fc669dbe2a8faeef19c8c8299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 6 Nov 2020 18:55:37 +0100 Subject: [PATCH] Fallback to 0 when index is undefined Fix #28 --- src/js/tempusdominus-core.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/tempusdominus-core.js b/src/js/tempusdominus-core.js index 8c4b5b3..d4f7a40 100644 --- a/src/js/tempusdominus-core.js +++ b/src/js/tempusdominus-core.js @@ -415,6 +415,7 @@ const DateTimePicker = (($, moment) => { } _setValue(targetMoment, index) { + index = index || 0; const oldDate = this.unset ? null : this._dates[index]; let outpValue = ''; // case of calling setValue(null or false)