Skip to content

Commit

Permalink
Fix noneOption undefined
Browse files Browse the repository at this point in the history
noneOption now clears input value ('')

Closes #622
  • Loading branch information
jonthornton committed Nov 20, 2017
1 parent ac8b68a commit 99f3247
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 9 deletions.
11 changes: 11 additions & 0 deletions __tests__/timepicker-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,14 @@ beforeEach(() => {
test("timepicker initializes", () => {
$(`#${TEST_INPUT}`).timepicker();
});

test("show single string noneOption correctly", () =>{
$(`#${TEST_INPUT}`).timepicker({
"noneOption": "----"
}).timepicker('show');

$('.ui-timepicker-list li:first-child').trigger('click');


expect($(`#${TEST_INPUT}`).val()).toEqual('');
});
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jt.timepicker",
"version": "1.11.12",
"version": "1.11.13",
"description": "A jQuery timepicker plugin inspired by Google Calendar.",
"homepage": "http://jonthornton.github.com/jquery-timepicker",
"main": ["./jquery.timepicker.js", "./jquery.timepicker.css"],
Expand Down
2 changes: 1 addition & 1 deletion jquery.timepicker.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for jQuery.timepicker 1.11.12
// Type definitions for jQuery.timepicker 1.11.13
// https://github.com/jonthornton/jquery-timepicker

/**
Expand Down
3 changes: 2 additions & 1 deletion jquery.timepicker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jquery-timepicker v1.11.12 - A jQuery timepicker plugin inspired by Google Calendar. It supports both mouse and keyboard navigation.
* jquery-timepicker v1.11.13 - 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
*/
Expand Down Expand Up @@ -739,6 +739,7 @@
value = optionValue.value;
} else if (typeof optionValue == "string") {
label = optionValue;
value = '';
} else {
$.error("Invalid noneOption value");
}
Expand Down
4 changes: 2 additions & 2 deletions jquery.timepicker.min.js

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "timepicker",
"version": "1.11.12",
"version": "1.11.13",
"title": "jquery-timepicker",
"author": {
"name": "Jon Thornton",
Expand All @@ -26,9 +26,14 @@
"prettier-eslint-cli": "^4.3.2"
},
"main": "jquery.timepicker.min.js",
"description":
"A jQuery timepicker plugin inspired by Google Calendar. It supports both mouse and keyboard navigation.",
"keywords": ["timepicker", "time", "picker", "ui", "google calendar"],
"description": "A jQuery timepicker plugin inspired by Google Calendar. It supports both mouse and keyboard navigation.",
"keywords": [
"timepicker",
"time",
"picker",
"ui",
"google calendar"
],
"homepage": "http://jonthornton.github.com/jquery-timepicker/",
"repository": {
"type": "git",
Expand Down

0 comments on commit 99f3247

Please sign in to comment.