diff --git a/js/bootstrap-datepicker.js b/js/bootstrap-datepicker.js
index f22b23674..18121b226 100644
--- a/js/bootstrap-datepicker.js
+++ b/js/bootstrap-datepicker.js
@@ -109,7 +109,7 @@
if (this.component && this.component.length === 0)
this.component = false;
- this.picker = $(DPGlobal.template);
+ this.picker = $(DPGlobal.template(this.o));
this._buildEvents();
this._attachEvents();
@@ -199,6 +199,9 @@
o.startView = Math.max(o.startView, o.minViewMode);
+ o.minutesStep = Math.max(defaults.minutesStep, o.minutesStep);
+ o.secondsStep = Math.max(defaults.secondsStep, o.secondsStep);
+
// true, false, or Number > 0
if (o.multidate !== true){
o.multidate = Number(o.multidate) || false;
@@ -976,7 +979,7 @@
break;
case 'today':
var date = new Date();
- date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
+ date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds());
this.showMode(-2);
var which = this.o.todayBtn === 'linked' ? null : 'view';
@@ -1302,6 +1305,7 @@
showTime: function(){
if (this.o.showTime) {
this.picker.find('[name=ampm]').hide();
+ this.picker.find('[name=second]').toggle(this.o.showSeconds);
} else {
if (!this.o.todayBtn && !this.o.clearBtn){
this.picker.find('tfoot').hide();
@@ -1473,10 +1477,13 @@
keyboardNavigation: true,
language: 'en',
minViewMode: 0,
+ minutesStep: 1,
multidate: false,
multidateSeparator: ',',
orientation: "auto",
rtl: false,
+ secondsStep: 1,
+ showSeconds: false,
showTime: false,
startDate: -Infinity,
startView: 0,
@@ -1596,13 +1603,13 @@
d: function(d,v){
return d.setUTCDate(v);
},
- h: function(d,v) {
+ h: function(d,v){
return d.setUTCHours(v);
},
- i: function(d,v) {
+ i: function(d,v){
return d.setUTCMinutes(v);
},
- s: function(d,v) {
+ s: function(d,v){
return d.setUTCSeconds(v);
}
},
@@ -1662,10 +1669,7 @@
if (typeof format === 'string')
format = DPGlobal.parseFormat(format);
- var
- hh = ('00' + date.getUTCHours()).slice(-2),
- mi = ('00' + date.getUTCMinutes()).slice(-2),
- ss = ('00' + date.getUTCSeconds()).slice(-2);
+ var hh = ('00' + date.getUTCHours()).slice(-2);
var val = {
d: date.getUTCDate(),
@@ -1678,10 +1682,8 @@
yyyy: date.getUTCFullYear(),
h: hh,
H: hh,
- i: mi,
- I: mi,
- s: ss,
- S: ss
+ i: ('00' + date.getUTCMinutes()).slice(-2),
+ s: ('00' + date.getUTCSeconds()).slice(-2)
};
val.dd = (val.d < 10 ? '0' : '') + val.d;
@@ -1696,10 +1698,10 @@
return date.join('');
},
- timepickerTemplate: function(){
- var optionTags = function(min, max){
+ timepickerTemplate: function (opts) {
+ var optionTags = function(min, max, step){
var s = '';
- for (var i = min; i < max; i++){
+ for (var i = min; i < max; i += step || 1) {
var val = ('0' + i).slice(-2);
s += '';
}
@@ -1707,17 +1709,17 @@
};
return '
'+
- '| '+
- ' |