Date picker test

I did a test changing the Web TextField type to date. It looks like the date picker works with all modern browsers but Safari on Mac.

If you want to test, add this code to the shown event:

me.ExecuteJavaScript("document.getElementById('" + me.ControlID + "_inner').type = 'date';")

This is how it looks in Chrome:

This is how it looks in Firefox:

Also working and tested on my Android phone, iPhone using Safari, Windows10 Edge (older and newest).

You will read the date as SQLDate (YYYY-MM-DD) and you can change that too using that format. I guess we need to be careful, I don’t know if some action will change the type ‘date’ back to ‘text’.

All but useless to me if it doesn’t support the Mac.

[quote=496309:@Alberto DePoo]I did a test changing the Web TextField type to date. It looks like the date picker works with all modern browsers but Safari on Mac.

If you want to test, add this code to the shown event:

me.ExecuteJavaScript("document.getElementById('" + me.ControlID + "_inner').type = 'date';")

This is how it looks in Chrome:

This is how it looks in Firefox:

Also working and tested on my Android phone, iPhone using Safari, Windows10 Edge (older and newest).

You will read the date as SQLDate (YYYY-MM-DD) and you can change that too using that format. I guess we need to be careful, I don’t know if some action will change the type ‘date’ back to ‘text’.[/quote]
This is a function of the browsers themselves, and yes they could change their minds at any time, but they tend not to about things like field types.

Yeah, sorry that Safari for Mac doesn’t support that.

I hope is beneficial to others. Maybe someone that targets Chrome and Firefox browsers, Windows10 and Edge, or mobile devices.

I was a little terse in my post earlier, I meant to put that this would be fantastic if it worked across all platforms but as I’m developing an app for a market that uses 70% MacOS then it’s a no go for my use case.

Clever work though Alberto.