Open mkinnan opened 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.
I am wondering if the date module errors are issues with drupalgap.js and not with date module.
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.
@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.
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.
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:
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 ...
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.