diff --git a/js/bootstrap-datetimepicker.js b/js/bootstrap-datetimepicker.js
index f66d69c1..31c33c10 100644
--- a/js/bootstrap-datetimepicker.js
+++ b/js/bootstrap-datetimepicker.js
@@ -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();
},
diff --git a/tests/run-qunit.js b/tests/run-qunit.js
index effdc3f1..84d5563f 100644
--- a/tests/run-qunit.js
+++ b/tests/run-qunit.js
@@ -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/';
diff --git a/tests/suites/options.js b/tests/suites/options.js
index d52d1951..5ff0cec3 100644
--- a/tests/suites/options.js
+++ b/tests/suites/options.js
@@ -288,6 +288,23 @@ test('DaysOfWeekDisabled', function(){
ok(target.hasClass('disabled'), 'Day of week is disabled');
});
+test('setDatesDisabled', function(){
+ var 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 = $('')
.appendTo('#qunit-fixture')