summaryrefslogtreecommitdiffstats
path: root/src/jquery-ui-timepicker-addon.js
diff options
context:
space:
mode:
authorTrent Richardson <trentdrichardson@gmail.com>2013-07-29 15:10:12 -0400
committerTrent Richardson <trentdrichardson@gmail.com>2013-07-29 15:10:12 -0400
commitcc200e3678db7a7517a68b9b9982bf98049fab35 (patch)
tree4efdefbf6107876f2f1c8a8049774511a32aab92 /src/jquery-ui-timepicker-addon.js
parent86ef1ba6372e4129fb47a912dae5927d0773a547 (diff)
downloadjQuery-Timepicker-Addon-cc200e3678db7a7517a68b9b9982bf98049fab35.zip
jQuery-Timepicker-Addon-cc200e3678db7a7517a68b9b9982bf98049fab35.tar.gz
jQuery-Timepicker-Addon-cc200e3678db7a7517a68b9b9982bf98049fab35.tar.bz2
fix lint issues, grunt less error
Diffstat (limited to 'src/jquery-ui-timepicker-addon.js')
-rw-r--r--src/jquery-ui-timepicker-addon.js17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/jquery-ui-timepicker-addon.js b/src/jquery-ui-timepicker-addon.js
index 37bfadb..38ddb4b 100644
--- a/src/jquery-ui-timepicker-addon.js
+++ b/src/jquery-ui-timepicker-addon.js
@@ -10,8 +10,6 @@
* http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
*/
-/*jslint evil: true, white: false, undef: false */
-
(function ($) {
/*
@@ -756,9 +754,8 @@
// If the update was done in the input field, the input field should not be updated.
// If the update was done using the sliders, update the input field.
- var hasChanged = (hour != this.hour || minute != this.minute || second != this.second || millisec != this.millisec || microsec != this.microsec
- || (this.ampm.length > 0 && (hour < 12) != ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1))
- || (this.timezone !== null && timezone != this.timezone));
+ var hasChanged = (hour !== this.hour || minute !== this.minute || second !== this.second || millisec !== this.millisec || microsec !== this.microsec ||
+ (this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) || (this.timezone !== null && timezone !== this.timezone));
if (hasChanged) {
@@ -1358,7 +1355,7 @@
// don't popup the datepicker if there is another instance already opened
var input = inst.input[0];
- if ($.datepicker._curInst && $.datepicker._curInst != inst && $.datepicker._datepickerShowing && $.datepicker._lastInput != input) {
+ if ($.datepicker._curInst && $.datepicker._curInst !== inst && $.datepicker._datepickerShowing && $.datepicker._lastInput !== input) {
return;
}
@@ -1410,9 +1407,9 @@
/*
* Fourth bad hack :/ override _updateAlternate function used in inline mode to init altField
+ * Update any alternate field to synchronise with the main field.
*/
$.datepicker._base_updateAlternate = $.datepicker._updateAlternate;
- /* Update any alternate field to synchronise with the main field. */
$.datepicker._updateAlternate = function (inst) {
var tp_inst = this._get(inst, 'timepicker');
if (tp_inst) {
@@ -1452,7 +1449,7 @@
tp_inst = $.datepicker._get(inst, 'timepicker');
if (tp_inst) {
- if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) {
+ if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {
try {
$.datepicker._updateDatepicker(inst);
} catch (err) {
@@ -1803,7 +1800,7 @@
var detectSupport = function (timeFormat) {
var tf = timeFormat.replace(/'.*?'/g, '').toLowerCase(), // removes literals
isIn = function (f, t) { // does the format contain the token?
- return !!(f.indexOf(t) !== -1);
+ return f.indexOf(t) !== -1 ? true : false;
};
return {
hour: isIn(tf, 'h'),
@@ -2098,7 +2095,7 @@
*/
$.timepicker.log = function (err) {
if (window.console) {
- console.log(err);
+ window.console.log(err);
}
};