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

Commit

Permalink
Fix for smalot#617. Added new test for setDatesDisabled. Fixed phanto…
Browse files Browse the repository at this point in the history
…mjs error.
  • Loading branch information
jgutix authored and AuspeXeu committed Nov 19, 2017
1 parent 0932cd5 commit 9e21d89
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
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

0 comments on commit 9e21d89

Please sign in to comment.