From 8172229516060a3bf4343483782153ec4fa348a7 Mon Sep 17 00:00:00 2001 From: Yann-Ducloux Date: Mon, 11 Jul 2016 16:37:07 +0200 Subject: [PATCH] adding a method that runs when the calendar clicks --- index2.html | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/datepickr.js | 4 ++++ 2 files changed, 49 insertions(+) create mode 100644 index2.html diff --git a/index2.html b/index2.html new file mode 100644 index 0000000..bb3725f --- /dev/null +++ b/index2.html @@ -0,0 +1,45 @@ + + + + Sample datepickrs + + + + + +

datepickr examples

+ + + + + + + + diff --git a/src/datepickr.js b/src/datepickr.js index deb3d52..d15ecb8 100644 --- a/src/datepickr.js +++ b/src/datepickr.js @@ -54,6 +54,7 @@ datepickr.init = function (element, instanceConfig) { dateFormat: 'F j, Y', altFormat: null, altInput: null, + altInputCallback: null, minDate: null, maxDate: null, shorthandCurrentMonth: false @@ -346,6 +347,9 @@ datepickr.init = function (element, instanceConfig) { // I don't know why someone would want to do this... but just in case? self.config.altInput.value = formatDate(self.config.dateFormat, currentTimestamp); } + if(self.config.altInputCallback){ + self.config.altInputCallback(self.config.altInput.value); + } } self.element.value = formatDate(self.config.dateFormat, currentTimestamp);