I've created a patch for the D7 version of the module to include the suite of date elements for HTML5 forms.
Not thoroughly tested but I think it's a good start. Whether they trigger the date pickers in all browsers or not is not really a huge concern for my use case. I'd just rather have the option to include the semantically correct elements. The Date module is where I would assume the date picker code can be borrowed from.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 876780-date_elements-1.patch | 7.35 KB | minoroffense |
| 876780-date_elements.patch | 7.35 KB | minoroffense |
Comments
Comment #1
minoroffense commentedThere was a typo in the datetime-local theme definition. I forgot the dash before local. Here's a new patch.
Comment #2
robcarrApplied the patch (thanks :)) but not sure I'm using it correctly. I've tried creating a date field in a content type (entity), but the
<input>tag still has type of 'text'... whereas I thought it may have type of 'date' once patched.And then there's the issue of where W3C have settled on the
<date>tag. But that's the future...Comment #3
robcarrEDIT:
Also popped into my head: datetime and datetime-local input types?Sorry - hadn't looked into your patch in great detail. All the HTML5 attributes are there, just not yet working for me
Comment #4
kaizerking commented@minorOffense-I dont see the following lines in dev version mentioned in the patch
' -142,3 +142,135 @@ function theme_rangefield($variables) {
return $output;
}
Comment #5
kaizerking commentedGot it
Comment #6
minoroffense commentedSorry, been away for a little while. Is there something wrong with the patch? Is there a problem with theme_rangefield?
Comment #7
jcfiala commentedWell, I applied the patch, and it's working fine for me - at least for the datefield element.
Comment #8
jcfiala commentedYeah, this works fine for me. Good patch.
Comment #9
kopeboyCan we have this in a release please!?
Comment #10
kingandyThe patch does work (for 'datefield' at least), as far as it goes.
It would be even better if the fields carried out some validation though .... not all browsers support HTML5 yet, which is fine because they'll degrade to the default type=text input, but does mean there's a danger that users could enter garbage data into these text fields. With the patch as-is it's down to each developer to implement these standard checks.
Comment #11
dasj19 commentedI would also like to have this in a release.