On 02/07/2012 01:55, James Ducker wrote:

element.valueAsDate

This property is designed to solve your locale woes, and it is also an
easy way to feature-detect a browser's native support for the date input
type. I haven't gone through all current browsers yet, so if you do use
this method, make sure to check that none of your browsers support the
property without implementing a date picker.

.valueAsDate, as you might have guessed, returns the input's value as a
Date object. Here's a super-simple feature detect:

if ( !myElement.valueAsDate ) {
    // Implement my JavaScript datepicker
}

You can also simply test if the "type" of your input is reported as "date". Older browsers that don't implement the new HTML5 types simply fall back to changing them - in the DOM itself - to type="text"

if (!myElement.type === "text") {
        // fallback
}

--
Patrick H. Lauke
______________________________________________________________
re·dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]

www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com | http://flickr.com/photos/redux/
______________________________________________________________
twitter: @patrick_h_lauke | skype: patrick_h_lauke
______________________________________________________________




*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
*******************************************************************

Reply via email to