Closed flupzor closed 6 years ago
But we are in control of the rendering of the value: we should just be able to make sure that the value that is rendered is ISO8601 formatted.
Whilst @schinckel is right, this particular set of templates are supposed to mimic the stock Django templates.
Are the failing tests something I should fix? I don't think this PR introduced the breakage, since I see another Travis build also fails with similar errors.
FWIW, I don't mind either way. Changing it the input types to 'text' will break certain existing templates which expect this to be there, but is the expected behavior for new users.
No, you didn't cause the failing tests, but I really would appreciate if you could spend a little time trying to find out why they happen :)
I've dug into this further, and it seems the problem is a change of attribute name between django 1.9 and 1.10... so I can fix it trivially if I drop support before 1.11.
For DateInput, DateTimeInput and TimeInput Django uses input_type 'text'. Align sniplates with this as well.
Using 'date', 'time' or 'datetime' is problematic because the HTML standard defines specific formatting for these input types. For example type 'date' requires a formatting of to be YYYY-MM-DD to be set in the 'value' attribute of the input element.
However the DateInput, DateTimeInput and TimeInput widgets use DATE_INPUT_FORMATS, DATETIME_INPUT_FORMATS and TIME_INPUT_FORMATS respectively to format the value. And these settings can, and often do, differ from what is required by browser/HTML 5.