allow data-datepicker and data-datetimepicker, fix

This commit is contained in:
vitalets
2013-07-21 03:35:14 +04:00
parent 40e0a890a2
commit 0eb6a0ffff
4 changed files with 23 additions and 1 deletions
src/inputs
date
datetime
test/unit

@ -133,7 +133,14 @@ $(function () {
equal(frmt(e.data('editable').value, 'yyyy-mm-dd'), d, 'value correct');
equal(e.text(), dview, 'text correct');
});
});
test("datepicker options can be defined in data-datepicker string", function () {
var e = $('<a href="#" data-type="date" data-datepicker="{weekStart: 2}" data-pk="1" data-url="/post"></a>').appendTo('#qunit-fixture').editable({
});
equal(e.data('editable').input.options.datepicker.weekStart, 2, 'options applied correct');
});
test("input should contain today if element is empty", function () {

@ -140,6 +140,15 @@ $(function () {
});
test("datetimepicker options can be defined in data-datetimepicker string", function () {
var e = $('<a href="#" data-type="datetime" data-datetimepicker="{weekStart: 2}" data-pk="1" data-url="/post"></a>').appendTo('#qunit-fixture').editable({
});
equal(e.data('editable').input.options.datetimepicker.weekStart, 2, 'options applied correct');
});
test("viewformat, init by value", function () {
var dview = '15/05/1984 15:45',
d = '1984-05-15 15:45',