Skip to content

Enables programmatic setting of the input display value upon initialization #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: calendar-dist
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dist/components/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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
Expand Down