cargomedia / cm

UNMAINTAINED - CM web application framework
MIT License
12 stars 18 forks source link

Use html5 date input for CM_FormField_Date? #1509

Closed njam closed 9 years ago

njam commented 10 years ago

Added: https://github.com/cargomedia/CM/pull/1305 Reverted: https://github.com/cargomedia/CM/issues/1508

Firefox 32 (might be selenium bot?)

ErrorException: E_WARNING: DateTime::__construct(): Failed to parse time string (------) at position 0 (-): Unexpected character in /home/app/releases/20141201173721/vendor/cargomedia/cm/library/CM/FormField/Date.php on line 19 

Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0


Windows Phone 8.1

Exception: DateTime::__construct(): Failed to parse time string (30 marzo) at position 6 (z): The timezone could not be found in the database in /home/app/releases/20141201173721/vendor/cargomedia/cm/library/CM/FormField/Date.php on line 19 

Mozilla/5.0 (Windows Phone 8.1; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; BLU; WIN JR W410a) like Gecko

Android 2.3

Exception: DateTime::__construct(): Failed to parse time string (--07-26) at position 0 (-): Unexpected character in /home/app/releases/20141201173721/vendor/cargomedia/cm/library/CM/FormField/Date.php on line 19 

Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; DROID X2 Build/4.5.1A-DTN-200-18) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1

Android 4.0

Exception: DateTime::__construct(): Failed to parse time string (010180) at position 4 (8): Unexpected character in /home/app/releases/20141201173721/vendor/cargomedia/cm/library/CM/FormField/Date.php on line 19 

Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; LG-MS770 Build/IMM76I) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
ErrorException: E_WARNING: DateTime::__construct(): Failed to parse time string (20) at position 0 (2): Unexpected character in /home/app/releases/20141201173721/vendor/cargomedia/cm/library/CM/FormField/Date.php on line 19 

Mozilla/5.0 (Linux; U; Android 4.0.4; en-gb; Blade III Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30

Android 4.2

Exception: DateTime::__construct(): Failed to parse time string (--09/12/1992) at position 0 (-): Unexpected character in /home/app/releases/20141201173721/vendor/cargomedia/cm/library/CM/FormField/Date.php on line 19 

Mozilla/5.0 (Linux; U; Android 4.2.2; en-us; HUAWEI Y330-U05 Build/HuaweiY330-U05) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
vogdb commented 9 years ago

I put a waiting label because until I will have a proper Android emulators, I'm not able to recreate the necessary environment to reproduce the above errors or to test whether these errors have gone due to my fix.

vogdb commented 9 years ago

Ok. We had problems because the devices you mentioned above didn't support HTML5 date. As an example lets take Android 4.0.3, 4.2.2, 4.3.1 and their default browser. It does not support HTML5 date and suggests by default a value --.

We have several options but all of them about narrowing down the set of devices where we enable HTML5 date. IEMobile can not be tested properly, it's hard to get their emulators, so I suggest to remove it in the first place.

Android default browser implement HTML5 date since 4.4. So, we can either cut the usage of Android to this version or exclude it totally. I think the answer to this is on our user stats. How many users do we have among Android 4.4 and higher? According to the info here https://developer.android.com/about/dashboards/index.html it shares 33% of the Androids.

@njam thoughts?

vogdb commented 9 years ago

@christopheschwyzer please share your thoughts too.

stophecom commented 9 years ago

Android stats: screen shot 2014-12-23 at 11 05 02

Even usage is still very low, I would narrow the implementation down to Android 4.4 and up. It's the future!

vogdb commented 9 years ago

Very fun. This issue now depends on #1558 because of ftlabs/fastclick#160.

vogdb commented 9 years ago

I found a very interesting info at http://caniuse.com/#search=date. Pay attention to an asterisk sign * in iOS Safari column header. It tells that iOS Safari in iOS7.1 does not support max and min attributes. I checked iOS8.1 + iPhone5/5s/6. They do not support these attributes too! It makes our birthdate field inconvenient to use. Users are forced to roll their year from 2014 all the time. I think we should drop this update for a time being because the only devices that support it is Android 4.4 and higher.

@njam @christopheschwyzer ?

stophecom commented 9 years ago

ok with me

vogdb commented 9 years ago

@njam You forgot about this one.

njam commented 9 years ago

Hmmm, agree. But then I'm under the impression it might be too early to do what we're trying here. Also I can't find any other web site from a big company using the date selection on mobile. How about we postpone this?

vogdb commented 9 years ago

As agreed by all of the contributors I close this issue until good times will come.