Skip to content

Commit

Permalink
1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
seonim-ryu committed Dec 5, 2017
1 parent 1b4140e commit fd7364e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/tui-time-picker.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 20 additions & 3 deletions dist/tui-time-picker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* tui-time-picker.js
* @version 1.1.0
* @version 1.1.1
* @author NHNEnt FE Development Lab <dl_javascript@nhnent.com>
* @license MIT
*/
Expand Down Expand Up @@ -393,6 +393,22 @@ return /******/ (function(modules) { // webpackBootstrap
return util.getRangeArr(0, 59, this._minuteStep);
},

/**
* Whether the hour and minute are in valid items or not
* @param {number} hour - Hour value
* @param {number} minute - Minute value
* @returns {boolean} State
* @private
*/
_validItems: function(hour, minute) {
if (this._showMeridiem) {
hour = util.getMeridiemHour(hour);
}

return snippet.inArray(hour, this._getHourItems()) > -1 &&
snippet.inArray(minute, this._getMinuteItems()) > -1;
},

/**
* Set step of hour
* @param {array} step - Step to create items of hour
Expand Down Expand Up @@ -466,12 +482,12 @@ return /******/ (function(modules) { // webpackBootstrap
*/
setTime: function(hour, minute) {
var isNumber = snippet.isNumber(hour) && snippet.isNumber(minute);

if (!isNumber || (hour > 23) || (minute > 59)) {
return;
}

if (!snippet.inArray(hour, this._getHourItems()) ||
!snippet.inArray(minute, this._getMinuteItems())) {
if (!this._validItems(hour, minute)) {
return;
}

Expand All @@ -480,6 +496,7 @@ return /******/ (function(modules) { // webpackBootstrap

this._syncToInputs();
this._syncToMeridiemElements();

/**
* Change event - TimePicker
* @event TimePicker#change
Expand Down
Loading

0 comments on commit fd7364e

Please sign in to comment.