signalpoint / date

The DrupalGap Date module.
0 stars 6 forks source link

Android - Users cannot set AM #26

Open mkinnan opened 8 years ago

mkinnan commented 8 years ago

Date module version 25 May 2016 ...

AM/PM cannot be set to AM for To or From date/time when app is compiled in Android. No issues in Ripple Emulator.

mkinnan commented 8 years ago

In the function date_assemble_form_state_into_field, the form_state_value argument displays the following in Ripple Emulator when AM is selected: 2016-06-19 08:30:00|2016-06-19 22:30:00 When the AM/PM button is toggled and set to AM in Android compiled app, form_state_value displays: 2016-06-19 20:30:00|2016-06-19 22:30:00 when viewing via USB debugging.

I believe the console.log error I am seeing in Ripple Emulator and Android: WARNING: list_assemble_form_state_into_field - unknown type (list_integer) is part of this.

mkinnan commented 8 years ago

I am wondering if the date module errors are issues with drupalgap.js and not with date module.

mkinnan commented 8 years ago

A little more digging and it appears it might be the date_select_onchange function. If you gave a date set to PM in Android, tap ampm widget and select AM, tap ampm widget again and select AM again the date saves as AM. There appears to be some strange behavior for the current value and set value in that function.

signalpoint commented 8 years ago

related commit: https://github.com/signalpoint/date/commit/0d7f700629e0bda30ff595d28db031bb85ce57fa

signalpoint commented 8 years ago

@mkinnan I think this should be fixed now. Although I didn't compile it and try it on Android devices specifically, but you definitely set me on the right path in regards to selecting AM, then selecting it again, that was definitely a bug.

mkinnan commented 8 years ago

Unfortunately, the issue is worse now. Before, the user could get a date saved going from AM to PM, but not PM to AM. Now, the user can't change AM or PM. Tested on Android with the specific commit above

When testing the date.js file containing all the commits from today, the issue is reversed where a user can go from PM to AM, but cannot get AM to PM saved.

mkinnan commented 8 years ago

Add a console.log message just inside the date_select_onchange function. Now, go to a node in Ripple Emulator and click edit on the node. Now, click the year/month/day/hour/minute ... the date_select_onchange function isn't called. Now, click the AM/PM widget and it's strange the date_select_onchange function IS called. Why is the date_select_onchange function being called only for the AM/PM widget but not any of the number based widgets?

Now, in the date_field_widget_form function, there is this chunk of code: widgets Why do all the numeric based widgets have their own function, but there isn't a _date_grain_widget_ampm function? This is the only thing I see that is different in the widgets ...