From ec01eb327b4578363b5763754d22043ce2ba7bbd Mon Sep 17 00:00:00 2001 From: MuhammedK Date: Wed, 27 Jan 2021 18:20:01 +0300 Subject: [PATCH] 'callback' parameter added --- dtsel.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dtsel.js b/dtsel.js index eedb237..a13ffa8 100644 --- a/dtsel.js +++ b/dtsel.js @@ -49,7 +49,7 @@ * @param {HTMLElement} elem * @param {Config} config */ - function DTS(elem, config) { + function DTS(elem, config, callback) { var config = config || {}; /** @type {Config} */ @@ -81,6 +81,7 @@ this.timeFormatRegEx = new RegExp("hh|mm|ss|a", "gi"); this.inputElem = elem; this.dtbox = null; + this.callback = callback; this.setup(); } DTS.prototype.setup = function () { @@ -508,6 +509,8 @@ strings.push(renderTime(joined, this.settings)); } this.elem.value = strings.join(', '); + if(this.settings.callback != undefined && this.settings.callback != null) + this.settings.callback(strings.join(', ')); } DTBox.prototype.onDateSelected = function (e) {