Skip to content

Commit dbc3869

Browse files
Merge branch 'dev'
2 parents 842046c + 3d0ada0 commit dbc3869

18 files changed

+185
-61
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jqueryui-timepicker-addon",
3-
"version": "1.4.3",
3+
"version": "1.4.4",
44
"repository": {
55
"type": "git",
66
"url": "git://github.com/trentrichardson/jQuery-Timepicker-Addon.git"

dist/i18n/jquery-ui-timepicker-de.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* Written by Marvin */
33
(function($) {
44
$.timepicker.regional['de'] = {
5-
timeOnlyTitle: 'Zeit Wählen',
5+
timeOnlyTitle: 'Zeit wählen',
66
timeText: 'Zeit',
77
hourText: 'Stunde',
88
minuteText: 'Minute',

dist/i18n/jquery-ui-timepicker-eu.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
/* Basque trannslation for JQuery Timepicker Addon
1+
/* Basque trannslation for JQuery Timepicker Addon */
22
/* Translated by Xabi Fer */
3+
/* Fixed by Asier Iturralde Sarasola - iametza interaktiboa */
34
(function($) {
45
$.timepicker.regional['eu'] = {
56
timeOnlyTitle: 'Aukeratu ordua',
67
timeText: 'Ordua',
78
hourText: 'Orduak',
89
minuteText: 'Minutuak',
9-
secondText: 'Segunduak',
10-
millisecText: 'Milisegunduak',
11-
microsecText: 'Mikrosegundotan',
10+
secondText: 'Segundoak',
11+
millisecText: 'Milisegundoak',
12+
microsecText: 'Mikrosegundoak',
1213
timezoneText: 'Ordu-eremua',
1314
currentText: 'Orain',
1415
closeText: 'Itxi',

dist/i18n/jquery-ui-timepicker-vi.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
hourText: 'Giờ',
88
minuteText: 'Phút',
99
secondText: 'Giây',
10-
millisecText: 'Phần nghìn giây',
11-
microsecText: 'Miligiây',
10+
millisecText: 'Mili giây',
11+
microsecText: 'Micrô giây',
1212
timezoneText: 'Múi giờ',
1313
currentText: 'Hiện thời',
1414
closeText: 'Đóng',
15-
timeFormat: 'H:m',
16-
amNames: ['SA', 'AM', 'A'],
17-
pmNames: ['CH', 'PM', 'P'],
15+
timeFormat: 'HH:mm',
16+
amNames: ['SA', 'S'],
17+
pmNames: ['CH', 'C'],
1818
isRTL: false
1919
};
2020
$.timepicker.setDefaults($.timepicker.regional['vi']);

dist/i18n/jquery-ui-timepicker-zh-CN.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
hourText: '小时',
88
minuteText: '分钟',
99
secondText: '秒钟',
10-
millisecText: '微秒',
10+
millisecText: '毫秒',
1111
microsecText: '微秒',
1212
timezoneText: '时区',
1313
currentText: '现在时间',

dist/index.html

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
.ebook .buyp a iframe{ margin-bottom: -5px; }
3939
</style>
4040

41-
<link rel="stylesheet" media="all" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
41+
<link rel="stylesheet" media="all" type="text/css" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" />
4242
<link rel="stylesheet" media="all" type="text/css" href="jquery-ui-timepicker-addon.css" />
4343

4444
</head>
@@ -124,9 +124,9 @@ <h3>Requirements</h3>
124124

125125
<br />
126126
<h3>Version</h3>
127-
<p>Version 1.4.3</p>
127+
<p>Version 1.4.4</p>
128128

129-
<p>Last updated on 2013-11-30</p>
129+
<p>Last updated on 2014-03-29</p>
130130
<p>jQuery Timepicker Addon is currently available for use in all personal or commercial projects under the MIT license.</p>
131131
<p><a href="http://trentrichardson.com/Impromptu/MIT-LICENSE.txt" title="MIT License">MIT License</a></p>
132132

@@ -337,6 +337,9 @@ <h3>Other Options</h3>
337337
<dt>timeOnly</dt>
338338
<dd><em>Default: false</em> - Hide the datepicker and only provide a time interface.</dd>
339339

340+
<dt>timeOnlyShowDate</dt>
341+
<dd><em>Default: false</em> - Show the date and time in the input, but only allow the timepicker.</dd>
342+
340343
<dt>onSelect</dt>
341344
<dd><em>Default: null</em> - Function to be called when a date is chosen or time has changed (parameters: datetimeText, datepickerInstance).</dd>
342345

@@ -370,6 +373,12 @@ <h3>Other Options</h3>
370373
<dt>maxDateTime</dt>
371374
<dd><em>Default: null</em> - Date object of the maximum datetime allowed. Also Available as maxDate.</dd>
372375

376+
<dt>minTime</dt>
377+
<dd><em>Default: null</em> - String of the minimum time allowed. '8:00 am' will restrict to times after 8am</dd>
378+
379+
<dt>maxTime</dt>
380+
<dd><em>Default: null</em> - String of the maximum time allowed. '8:00 pm' will restrict to times before 8pm</dd>
381+
373382
<dt>parse</dt>
374383
<dd><em>Default: 'strict'</em> - How to parse the time string. Two methods are provided: 'strict' which must match the timeFormat exactly, and 'loose' which uses javascript's new Date(timeString) to guess the time. You may also pass in a function(timeFormat, timeString, options) to handle the parsing yourself, returning a simple object:
375384
<pre>{
@@ -939,8 +948,8 @@ <h3 id="utility_examples">Utilities</h3>
939948
</div>
940949

941950

942-
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
943-
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
951+
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
952+
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
944953
<script type="text/javascript" src="jquery-ui-timepicker-addon.js"></script>
945954
<script type="text/javascript" src="jquery-ui-sliderAccess.js"></script>
946955

dist/jquery-ui-timepicker-addon.js

Lines changed: 65 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/*! jQuery Timepicker Addon - v1.4.3 - 2013-11-30
1+
/*! jQuery Timepicker Addon - v1.4.4 - 2014-03-29
22
* http://trentrichardson.com/examples/timepicker
3-
* Copyright (c) 2013 Trent Richardson; Licensed MIT */
3+
* Copyright (c) 2014 Trent Richardson; Licensed MIT */
44
(function ($) {
55

66
/*
@@ -16,7 +16,7 @@
1616
*/
1717
$.extend($.ui, {
1818
timepicker: {
19-
version: "1.4.3"
19+
version: "1.4.4"
2020
}
2121
});
2222

@@ -48,6 +48,7 @@
4848
this._defaults = { // Global defaults for all the datetime picker instances
4949
showButtonPanel: true,
5050
timeOnly: false,
51+
timeOnlyShowDate: false,
5152
showHour: null,
5253
showMinute: null,
5354
showSecond: null,
@@ -78,6 +79,8 @@
7879
microsecMax: 999,
7980
minDateTime: null,
8081
maxDateTime: null,
82+
maxTime: null,
83+
minTime: null,
8184
onSelect: null,
8285
hourGrid: 0,
8386
minuteGrid: 0,
@@ -114,6 +117,8 @@
114117
millisec_slider: null,
115118
microsec_slider: null,
116119
timezone_select: null,
120+
maxTime: null,
121+
minTime: null,
117122
hour: 0,
118123
minute: 0,
119124
second: 0,
@@ -660,6 +665,44 @@
660665
}
661666
}
662667

668+
if (dp_inst.settings.minTime!==null) {
669+
var tempMinTime=new Date("01/01/1970 " + dp_inst.settings.minTime);
670+
if (this.hour<tempMinTime.getHours()) {
671+
this.hour=this._defaults.hourMin=tempMinTime.getHours();
672+
this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();
673+
} else if (this.hour===tempMinTime.getHours() && this.minute<tempMinTime.getMinutes()) {
674+
this.minute=this._defaults.minuteMin=tempMinTime.getMinutes();
675+
} else {
676+
if (this._defaults.hourMin<tempMinTime.getHours()) {
677+
this._defaults.hourMin=tempMinTime.getHours();
678+
this._defaults.minuteMin=tempMinTime.getMinutes();
679+
} else if (this._defaults.hourMin===tempMinTime.getHours()===this.hour && this._defaults.minuteMin<tempMinTime.getMinutes()) {
680+
this._defaults.minuteMin=tempMinTime.getMinutes();
681+
} else {
682+
this._defaults.minuteMin=0;
683+
}
684+
}
685+
}
686+
687+
if (dp_inst.settings.maxTime!==null) {
688+
var tempMaxTime=new Date("01/01/1970 " + dp_inst.settings.maxTime);
689+
if (this.hour>tempMaxTime.getHours()) {
690+
this.hour=this._defaults.hourMax=tempMaxTime.getHours();
691+
this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();
692+
} else if (this.hour===tempMaxTime.getHours() && this.minute>tempMaxTime.getMinutes()) {
693+
this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes();
694+
} else {
695+
if (this._defaults.hourMax>tempMaxTime.getHours()) {
696+
this._defaults.hourMax=tempMaxTime.getHours();
697+
this._defaults.minuteMax=tempMaxTime.getMinutes();
698+
} else if (this._defaults.hourMax===tempMaxTime.getHours()===this.hour && this._defaults.minuteMax>tempMaxTime.getMinutes()) {
699+
this._defaults.minuteMax=tempMaxTime.getMinutes();
700+
} else {
701+
this._defaults.minuteMax=59;
702+
}
703+
}
704+
}
705+
663706
if (adjustSliders !== undefined && adjustSliders === true) {
664707
var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10),
665708
minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10),
@@ -668,23 +711,23 @@
668711
microsecMax = parseInt((this._defaults.microsecMax - ((this._defaults.microsecMax - this._defaults.microsecMin) % this._defaults.stepMicrosec)), 10);
669712

670713
if (this.hour_slider) {
671-
this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax });
714+
this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax, step: this._defaults.stepHour });
672715
this.control.value(this, this.hour_slider, 'hour', this.hour - (this.hour % this._defaults.stepHour));
673716
}
674717
if (this.minute_slider) {
675-
this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax });
718+
this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax, step: this._defaults.stepMinute });
676719
this.control.value(this, this.minute_slider, 'minute', this.minute - (this.minute % this._defaults.stepMinute));
677720
}
678721
if (this.second_slider) {
679-
this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax });
722+
this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax, step: this._defaults.stepSecond });
680723
this.control.value(this, this.second_slider, 'second', this.second - (this.second % this._defaults.stepSecond));
681724
}
682725
if (this.millisec_slider) {
683-
this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax });
726+
this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax, step: this._defaults.stepMillisec });
684727
this.control.value(this, this.millisec_slider, 'millisec', this.millisec - (this.millisec % this._defaults.stepMillisec));
685728
}
686729
if (this.microsec_slider) {
687-
this.control.options(this, this.microsec_slider, 'microsec', { min: this._defaults.microsecMin, max: microsecMax });
730+
this.control.options(this, this.microsec_slider, 'microsec', { min: this._defaults.microsecMin, max: microsecMax, step: this._defaults.stepMicrosec });
688731
this.control.value(this, this.microsec_slider, 'microsec', this.microsec - (this.microsec % this._defaults.stepMicrosec));
689732
}
690733
}
@@ -806,7 +849,7 @@
806849
this.timeDefined = true;
807850
if (hasChanged) {
808851
this._updateDateTime();
809-
this.$input.focus();
852+
//this.$input.focus(); // may automatically open the picker on setDate
810853
}
811854
},
812855

@@ -855,9 +898,9 @@
855898
// return;
856899
//}
857900

858-
if (this._defaults.timeOnly === true) {
901+
if (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === false) {
859902
formattedDateTime = this.formattedTime;
860-
} else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
903+
} else if ((this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) || (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === true)) {
861904
formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix;
862905
}
863906

@@ -1342,7 +1385,7 @@
13421385
var inst = this._getInst($(id)[0]),
13431386
tp_inst = this._get(inst, 'timepicker');
13441387

1345-
if (tp_inst) {
1388+
if (tp_inst && inst.settings.showTimepicker) {
13461389
tp_inst._limitMinMaxDateTime(inst, true);
13471390
inst.inline = inst.stay_open = true;
13481391
//This way the onSelect handler called from calendarpicker get the full dateTime
@@ -2034,6 +2077,13 @@
20342077
end: {} // options for end picker
20352078
}, options);
20362079

2080+
// for the mean time this fixes an issue with calling getDate with timepicker()
2081+
var timeOnly = false;
2082+
if(method === 'timepicker'){
2083+
timeOnly = true;
2084+
method = 'datetimepicker';
2085+
}
2086+
20372087
function checkDates(changed, other) {
20382088
var startdt = startTime[method]('getDate'),
20392089
enddt = endTime[method]('getDate'),
@@ -2077,6 +2127,7 @@
20772127
}
20782128

20792129
$.fn[method].call(startTime, $.extend({
2130+
timeOnly: timeOnly,
20802131
onClose: function (dateText, inst) {
20812132
checkDates($(this), endTime);
20822133
},
@@ -2085,6 +2136,7 @@
20852136
}
20862137
}, options, options.start));
20872138
$.fn[method].call(endTime, $.extend({
2139+
timeOnly: timeOnly,
20882140
onClose: function (dateText, inst) {
20892141
checkDates($(this), startTime);
20902142
},
@@ -2140,6 +2192,6 @@
21402192
/*
21412193
* Keep up with the version
21422194
*/
2143-
$.timepicker.version = "1.4.3";
2195+
$.timepicker.version = "1.4.4";
21442196

21452197
})(jQuery);

dist/jquery-ui-timepicker-addon.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery-ui-timepicker-addon.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jquery-ui-timepicker-addon.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "jquery-ui-timepicker-addon",
33
"title": "jQuery Timepicker Addon",
44
"description": "A timepicker addon for jQueryUI datepicker.",
5-
"version": "1.4.3",
6-
"modified": "2013-11-30",
5+
"version": "1.4.4",
6+
"modified": "2014-03-29",
77
"homepage": "http://trentrichardson.com/examples/timepicker",
88
"author": {
99
"name": "Trent Richardson",

src/docs/footer.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
</div>
55

66

7-
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
8-
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
7+
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
8+
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
99
<script type="text/javascript" src="jquery-ui-timepicker-addon.js"></script>
1010
<script type="text/javascript" src="jquery-ui-sliderAccess.js"></script>
1111

src/docs/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
.ebook .buyp a iframe{ margin-bottom: -5px; }
3939
</style>
4040

41-
<link rel="stylesheet" media="all" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
41+
<link rel="stylesheet" media="all" type="text/css" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" />
4242
<link rel="stylesheet" media="all" type="text/css" href="jquery-ui-timepicker-addon.css" />
4343

4444
</head>

src/docs/options.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ <h3>Other Options</h3>
203203
<dt>timeOnly</dt>
204204
<dd><em>Default: false</em> - Hide the datepicker and only provide a time interface.</dd>
205205

206+
<dt>timeOnlyShowDate</dt>
207+
<dd><em>Default: false</em> - Show the date and time in the input, but only allow the timepicker.</dd>
208+
206209
<dt>onSelect</dt>
207210
<dd><em>Default: null</em> - Function to be called when a date is chosen or time has changed (parameters: datetimeText, datepickerInstance).</dd>
208211

@@ -236,6 +239,12 @@ <h3>Other Options</h3>
236239
<dt>maxDateTime</dt>
237240
<dd><em>Default: null</em> - Date object of the maximum datetime allowed. Also Available as maxDate.</dd>
238241

242+
<dt>minTime</dt>
243+
<dd><em>Default: null</em> - String of the minimum time allowed. '8:00 am' will restrict to times after 8am</dd>
244+
245+
<dt>maxTime</dt>
246+
<dd><em>Default: null</em> - String of the maximum time allowed. '8:00 pm' will restrict to times before 8pm</dd>
247+
239248
<dt>parse</dt>
240249
<dd><em>Default: 'strict'</em> - How to parse the time string. Two methods are provided: 'strict' which must match the timeFormat exactly, and 'loose' which uses javascript's new Date(timeString) to guess the time. You may also pass in a function(timeFormat, timeString, options) to handle the parsing yourself, returning a simple object:
241250
<pre>{

src/i18n/jquery-ui-timepicker-de.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* Written by Marvin */
33
(function($) {
44
$.timepicker.regional['de'] = {
5-
timeOnlyTitle: 'Zeit Wählen',
5+
timeOnlyTitle: 'Zeit wählen',
66
timeText: 'Zeit',
77
hourText: 'Stunde',
88
minuteText: 'Minute',

src/i18n/jquery-ui-timepicker-eu.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
/* Basque trannslation for JQuery Timepicker Addon
1+
/* Basque trannslation for JQuery Timepicker Addon */
22
/* Translated by Xabi Fer */
3+
/* Fixed by Asier Iturralde Sarasola - iametza interaktiboa */
34
(function($) {
45
$.timepicker.regional['eu'] = {
56
timeOnlyTitle: 'Aukeratu ordua',
67
timeText: 'Ordua',
78
hourText: 'Orduak',
89
minuteText: 'Minutuak',
9-
secondText: 'Segunduak',
10-
millisecText: 'Milisegunduak',
11-
microsecText: 'Mikrosegundotan',
10+
secondText: 'Segundoak',
11+
millisecText: 'Milisegundoak',
12+
microsecText: 'Mikrosegundoak',
1213
timezoneText: 'Ordu-eremua',
1314
currentText: 'Orain',
1415
closeText: 'Itxi',

0 commit comments

Comments
 (0)