Skip to content

Test `<input type=datetime>.valueAsDate` #133

Closed
pornel opened this Issue Apr 16, 2012 · 2 comments

2 participants

@pornel
pornel commented Apr 16, 2012

input.valueAsDate doesn't seem to be implemented in any browser any more.

I'd expect this to return Date object:

$('<input type=datetime value="2012-04-16">')[0].valueAsDate

but I'm getting null in Opera 11.62, despite passing support for input type=datetime in the test.

@NielsLeenheer
Owner

I'll add an test for valueAsDate in the next release.

@NielsLeenheer NielsLeenheer reopened this Jul 10, 2012
@NielsLeenheer
Owner

Added valueAsDate and valueAsNumber as a new test for the next release (currently at alpha.html5test.com). The result in the example you give above is as expected however. "2012-04-16" isn't a valid value for a datetime field. valueAsDate is null for invalid values.

The example below seems to work fine:

e = document.createElement('input');
e.type = 'date';
e.value='2010-10-10';
e.valueAsDate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.