From b37805df6f37faebf99a5851a0268768a74629dd Mon Sep 17 00:00:00 2001 From: Douglas Gaskell Date: Sun, 25 Sep 2016 14:01:50 -0700 Subject: [PATCH] Adds displayValue to settings Adds a settings property that can be used to programmatically set the view value upon initialization. --- dist/components/calendar.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/components/calendar.js b/dist/components/calendar.js index 5695a08339..39c7015e46 100644 --- a/dist/components/calendar.js +++ b/dist/components/calendar.js @@ -156,7 +156,7 @@ }, date: function () { if ($input.length) { - var val = $input.val(); + var val = settings.displayValue ? settings.displayValue :$input.val(); var date = parser.date(val, settings); module.set.date(date, settings.formatInput, false); } @@ -918,6 +918,7 @@ inline: false, // create the calendar inline instead of inside a popup on: null, // when to show the popup (defaults to 'focus' for input, 'click' for others) initialDate: null, // date to display initially when no date is selected (null = now) + displayValue: null, // date to display in input (formatted with formatter) startMode: false, // display mode to start in, can be 'year', 'month', 'day', 'hour', 'minute' (false = 'day') minDate: null, // minimum date/time that can be selected, dates/times before are disabled maxDate: null, // maximum date/time that can be selected, dates/times after are disabled