Skip to content

Commit e752ef7

Browse files
Merge branch 'dev'
2 parents a9ba30d + 7bdc82c commit e752ef7

File tree

3 files changed

+43
-15
lines changed

3 files changed

+43
-15
lines changed

component.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "jquery-timepicker-addon",
3+
"version": "1.2",
4+
"repository": {
5+
"type": "git",
6+
"url": "git://github.com/trentrichardson/jQuery-Timepicker-Addon.git"
7+
},
8+
"dependencies": {
9+
"jquery-ui": "~1.9.2"
10+
}
11+
}

index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ <h3>Requirements</h3>
122122

123123

124124
<h3>Version</h3>
125-
<p>Version 1.1.2</p>
125+
<p>Version 1.2</p>
126126

127-
<p>Last updated on 01/19/2013</p>
127+
<p>Last updated on 02/02/2013</p>
128128
<p>jQuery Timepicker Addon is currently available for use in all personal or commercial projects under both MIT and GPL licenses. This means that you can choose the license that best suits your project, and use it accordingly. </p>
129129
<p><a href="http://trentrichardson.com/Impromptu/GPL-LICENSE.txt" title="GPL License">GPL License</a></p>
130130
<p><a href="http://trentrichardson.com/Impromptu/MIT-LICENSE.txt" title="MIT License">MIT License</a></p>

jquery-ui-timepicker-addon.js

+30-13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/*
22
* jQuery timepicker addon
33
* By: Trent Richardson [http://trentrichardson.com]
4-
* Version 1.1.2
5-
* Last Modified: 01/19/2013
4+
* Version 1.2
5+
* Last Modified: 02/02/2013
66
*
7-
* Copyright 2012 Trent Richardson
7+
* Copyright 2013 Trent Richardson
88
* You may use this project under MIT or GPL licenses.
99
* http://trentrichardson.com/Impromptu/GPL-LICENSE.txt
1010
* http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
@@ -27,7 +27,7 @@
2727
*/
2828
$.extend($.ui, {
2929
timepicker: {
30-
version: "1.1.2"
30+
version: "1.2"
3131
}
3232
});
3333

@@ -37,7 +37,7 @@
3737
* Settings for (groups of) time pickers are maintained in an instance object,
3838
* allowing multiple different settings on the same page.
3939
*/
40-
function Timepicker() {
40+
var Timepicker = function() {
4141
this.regional = []; // Available regional settings, indexed by language code
4242
this.regional[''] = { // Default regional settings
4343
currentText: 'Now',
@@ -108,7 +108,7 @@
108108
parse: 'strict'
109109
};
110110
$.extend(this._defaults, this.regional['']);
111-
}
111+
};
112112

113113
$.extend(Timepicker.prototype, {
114114
$input: null,
@@ -311,7 +311,7 @@
311311
}
312312
$.extend(this, parseRes.timeObj);
313313
} catch (err) {
314-
$.datepicker.log("Error parsing the date/time string: " + err +
314+
$.timepicker.log("Error parsing the date/time string: " + err +
315315
"\ndate/time string = " + timeString +
316316
"\ntimeFormat = " + this._defaults.timeFormat +
317317
"\ndateFormat = " + dp_dateFormat);
@@ -767,6 +767,13 @@
767767
timeAvailable = dt !== null && this.timeDefined;
768768
this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
769769
var formattedDateTime = this.formattedDate;
770+
771+
// if a slider was changed but datepicker doesn't have a value yet, set it
772+
if(dp_inst.lastVal==""){
773+
dp_inst.currentYear=dp_inst.selectedYear;
774+
dp_inst.currentMonth=dp_inst.selectedMonth;
775+
dp_inst.currentDay=dp_inst.selectedDay;
776+
}
770777

771778
/*
772779
* remove following lines to force every changes in date picker to change the input value
@@ -819,7 +826,7 @@
819826
try {
820827
$.datepicker._updateDatepicker(inst);
821828
} catch (err) {
822-
$.datepicker.log(err);
829+
$.timepicker.log(err);
823830
}
824831
}
825832
}
@@ -1156,7 +1163,7 @@
11561163
return strictParse(f,s,o);
11571164
}
11581165
catch(err2){
1159-
$.datepicker.log("Unable to parse \ntimeString: "+ s +"\ntimeFormat: "+ f);
1166+
$.timepicker.log("Unable to parse \ntimeString: "+ s +"\ntimeFormat: "+ f);
11601167
}
11611168
}
11621169
return false;
@@ -1366,7 +1373,7 @@
13661373
try {
13671374
$.datepicker._updateDatepicker(inst);
13681375
} catch (err) {
1369-
$.datepicker.log(err);
1376+
$.timepicker.log(err);
13701377
}
13711378
}
13721379
}
@@ -1532,7 +1539,7 @@
15321539
// the "extra" characters. We rely on that instead of
15331540
// attempting to perfectly reproduce the parsing algorithm.
15341541
date = this._base_parseDate(format, value.substring(0,value.length-(err.length-err.indexOf(':')-2)), settings);
1535-
$.datepicker.log("Error parsing the date string: " + err + "\ndate string = " + value + "\ndate format = " + format);
1542+
$.timepicker.log("Error parsing the date string: " + err + "\ndate string = " + value + "\ndate format = " + format);
15361543
}
15371544
return date;
15381545
};
@@ -1707,7 +1714,7 @@
17071714
}
17081715

17091716
} catch (err) {
1710-
$.datepicker.log('Could not split the date from the time. Please check the following datetimepicker options' +
1717+
$.timepicker.log('Could not split the date from the time. Please check the following datetimepicker options' +
17111718
"\nthrown error: " + err +
17121719
"\ndateTimeString" + dateTimeString +
17131720
"\ndateFormat = " + dateFormat +
@@ -1894,9 +1901,19 @@
18941901
return $([startTime.get(0), endTime.get(0)]);
18951902
};
18961903

1904+
/**
1905+
* Log error or data to the console during error or debugging
1906+
* @param Object err pass any type object to log to the console during error or debugging
1907+
* @return void
1908+
*/
1909+
$.timepicker.log = function(err){
1910+
if(window.console)
1911+
console.log(err);
1912+
};
1913+
18971914
/*
18981915
* Keep up with the version
18991916
*/
1900-
$.timepicker.version = "1.1.2";
1917+
$.timepicker.version = "1.2";
19011918

19021919
})(jQuery);

0 commit comments

Comments
 (0)