Skip to content
This repository has been archived by the owner on Jun 22, 2018. It is now read-only.

Fix resetting of viewDate #2

Merged
merged 1 commit into from
Nov 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/bootstrap-datetimepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@
this.datesDisabled = $.map(this.datesDisabled, function (d) {
return DPGlobal.parseDate(d, mThis.format, mThis.language, mThis.formatType, mThis.timezone).toDateString();
});
this.update();
this.fill();
this.updateNavArrows();
},

Expand Down
4 changes: 2 additions & 2 deletions tests/run-qunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ page.onError = function (msg, trace) {
console.log(' ', item.file, ':', item.line);
})
}

var _openPath = phantom.args[0].replace(/^.*(\\|\/)/, '');
args = system.args.toString().split(',');
var _openPath = args[1].replace(/^.*(\\|\/)/, '');
var openPath = _openPath;
var origdir = '../js/';
var basedir = '../instrumented/';
Expand Down
17 changes: 17 additions & 0 deletions tests/suites/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,23 @@ test('DaysOfWeekDisabled', function(){
ok(target.hasClass('disabled'), 'Day of week is disabled');
});

test('setDatesDisabled', function(){
var input = $('<input />')
.appendTo('#qunit-fixture')
.val('2012-10-26')
.datetimepicker({
format: 'yyyy-mm-dd',
}),
dp = input.data('datetimepicker'),
picker = dp.picker,
target;

input.datetimepicker('setDatesDisabled', ['2012-10-28']);
input.focus();
target = picker.find('.datetimepicker-days tbody td:nth(28)');
ok(target.hasClass('disabled'), 'Set dates disabled');
});

test('startDate: Custom value', function(){
var input = $('<input />')
.appendTo('#qunit-fixture')
Expand Down