Permalink
Browse files

Improvements to option method

- Apply timeFormat to selected value when option changes
- Apply time range validations and emit timeRangeError on option changes

Close #576
1 parent acefd81 commit 0aea5070b60d3cd2d0e5dd0fc5cbb91fe137e75b @jonthornton committed Dec 13, 2016
Showing with 9 additions and 7 deletions.
  1. +1 −1 bower.json
  2. +1 −1 jquery.timepicker.d.ts
  3. +4 −2 jquery.timepicker.js
  4. +2 −2 jquery.timepicker.min.js
  5. +1 −1 package.json
View
@@ -1,6 +1,6 @@
{
"name" : "jt.timepicker",
- "version" : "1.11.8",
+ "version" : "1.11.9",
"description" : "A jQuery timepicker plugin inspired by Google Calendar.",
"homepage" : "http://jonthornton.github.com/jquery-timepicker",
"main" : [ "./jquery.timepicker.js", "./jquery.timepicker.css" ],
@@ -1,4 +1,4 @@
-// Type definitions for jQuery.timepicker 1.11.8
+// Type definitions for jQuery.timepicker 1.11.9
// https://github.com/jonthornton/jquery-timepicker
/**
@@ -1,5 +1,5 @@
/*!
- * jquery-timepicker v1.11.8 - A jQuery timepicker plugin inspired by Google Calendar. It supports both mouse and keyboard navigation.
+ * jquery-timepicker v1.11.9 - A jQuery timepicker plugin inspired by Google Calendar. It supports both mouse and keyboard navigation.
* Copyright (c) 2015 Jon Thornton - http://jonthornton.github.com/jquery-timepicker/
* License: MIT
*/
@@ -243,6 +243,8 @@
self.data('timepicker-settings', settings);
+ _formatValue.call(self.get(0), {'type':'change'}, 'initial');
+
if (list) {
list.remove();
self.data('timepicker-list', false);
@@ -758,7 +760,7 @@
var prettyTime = _int2time(seconds, settings);
if (rangeError) {
- if (_setTimeValue(self, prettyTime, 'error')) {
+ if (_setTimeValue(self, prettyTime, 'error') || e && e.type == 'change') {
self.trigger('timeRangeError');
}
} else {
Oops, something went wrong.
View
@@ -1,6 +1,6 @@
{
"name": "timepicker",
- "version": "1.11.8",
+ "version": "1.11.9",
"title": "jquery-timepicker",
"author": {
"name": "Jon Thornton",

0 comments on commit 0aea507

Please sign in to comment.