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.

Comments

minoroffense’s picture

StatusFileSize
new7.35 KB

There was a typo in the datetime-local theme definition. I forgot the dash before local. Here's a new patch.

robcarr’s picture

Applied 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...

robcarr’s picture

EDIT: 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

kaizerking’s picture

Issue tags: +where is this

@minorOffense-I dont see the following lines in dev version mentioned in the patch
' -142,3 +142,135 @@ function theme_rangefield($variables) {

return $output;
}

kaizerking’s picture

Got it

minoroffense’s picture

Sorry, been away for a little while. Is there something wrong with the patch? Is there a problem with theme_rangefield?

jcfiala’s picture

Issue summary: View changes

Well, I applied the patch, and it's working fine for me - at least for the datefield element.

jcfiala’s picture

Status: Needs review » Reviewed & tested by the community

Yeah, this works fine for me. Good patch.

kopeboy’s picture

Can we have this in a release please!?

kingandy’s picture

The 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.

dasj19’s picture

I would also like to have this in a release.