Skip to content

Commit a623c56

Browse files
Cleanup code
1 parent 0c3e016 commit a623c56

File tree

1 file changed

+3
-27
lines changed

1 file changed

+3
-27
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,6 @@
717717
this.ampm = ampm;
718718
}
719719

720-
//this._formatTime();
721720
this.formattedTime = $.datepicker.formatTime(this._defaults.timeFormat, this, this._defaults);
722721
if (this.$timeObj) {
723722
this.$timeObj.text(this.formattedTime + o.timeSuffix);
@@ -740,29 +739,6 @@
740739
}
741740
},
742741

743-
/*
744-
* left for any backwards compatibility
745-
*/
746-
_formatTime: function(time, format) {
747-
time = time || {
748-
hour: this.hour,
749-
minute: this.minute,
750-
second: this.second,
751-
millisec: this.millisec,
752-
ampm: this.ampm,
753-
timezone: this.timezone
754-
};
755-
var tmptime = (format || this._defaults.timeFormat).toString();
756-
757-
tmptime = $.datepicker.formatTime(tmptime, time, this._defaults);
758-
759-
if (arguments.length) {
760-
return tmptime;
761-
} else {
762-
this.formattedTime = tmptime;
763-
}
764-
},
765-
766742
/*
767743
* update our input with the new date time..
768744
*/
@@ -881,7 +857,7 @@
881857
sel += ' '+ ((i<12)? tp_inst._defaults.amNames[0] : tp_inst._defaults.pmNames[0])[ul]();
882858
}
883859
else if(unit == 'millisec') sel += i;
884-
else sel += ('0'+ i.toString()).substr(-2)
860+
else sel += ('0'+ i.toString()).substr(-2);
885861
sel += '</option>';
886862
}
887863
sel += '</select>';
@@ -899,7 +875,7 @@
899875
var o = {},
900876
$t = obj.children('select');
901877
if(typeof(opts) == 'string'){
902-
if(val == undefined)
878+
if(val === undefined)
903879
return $t.data(opts);
904880
o[opts] = val;
905881
}
@@ -1265,7 +1241,7 @@
12651241
$.datepicker._base_updateAlternate = $.datepicker._updateAlternate;
12661242
/* Update any alternate field to synchronise with the main field. */
12671243
$.datepicker._updateAlternate = function(inst) {
1268-
tp_inst = this._get(inst, 'timepicker');
1244+
var tp_inst = this._get(inst, 'timepicker');
12691245
if(tp_inst){
12701246
var altField = tp_inst._defaults.altField;
12711247
if (altField) { // update alternate field too

0 commit comments

Comments
 (0)