summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/docs/options.html3
-rw-r--r--src/jquery-ui-timepicker-addon.js5
2 files changed, 6 insertions, 2 deletions
diff --git a/src/docs/options.html b/src/docs/options.html
index 941028d..3cecb5a 100644
--- a/src/docs/options.html
+++ b/src/docs/options.html
@@ -203,6 +203,9 @@
<dt>timeOnly</dt>
<dd><em>Default: false</em> - Hide the datepicker and only provide a time interface.</dd>
+ <dt>timeOnlyShowDate</dt>
+ <dd><em>Default: false</em> - Show the date and time in the input, but only allow the timepicker.</dd>
+
<dt>onSelect</dt>
<dd><em>Default: null</em> - Function to be called when a date is chosen or time has changed (parameters: datetimeText, datepickerInstance).</dd>
diff --git a/src/jquery-ui-timepicker-addon.js b/src/jquery-ui-timepicker-addon.js
index 6dfcdcc..25f9c74 100644
--- a/src/jquery-ui-timepicker-addon.js
+++ b/src/jquery-ui-timepicker-addon.js
@@ -54,6 +54,7 @@
this._defaults = { // Global defaults for all the datetime picker instances
showButtonPanel: true,
timeOnly: false,
+ timeOnlyShowDate: false,
showHour: null,
showMinute: null,
showSecond: null,
@@ -903,9 +904,9 @@
// return;
//}
- if (this._defaults.timeOnly === true) {
+ if (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === false) {
formattedDateTime = this.formattedTime;
- } else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
+ } else if ((this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) || (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === true)) {
formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix;
}