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

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

Comments

Projects
None yet
2 participants
@kornelski

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

This comment has been minimized.

Show comment
Hide comment
@NielsLeenheer

NielsLeenheer Apr 29, 2012

Collaborator

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

Collaborator

NielsLeenheer commented Apr 29, 2012

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

@NielsLeenheer

This comment has been minimized.

Show comment
Hide comment
@NielsLeenheer

NielsLeenheer Jul 10, 2012

Collaborator

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
Collaborator

NielsLeenheer commented Jul 10, 2012

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