"Ask for Approval" Due Date Rules not working as expected in Orlando when system date format is dd-MM-yyyy


Description

1. "Ask for Approval" Due Date Rules not working as expected in Orlando
2. When the "Ask for Approval" action Rules is configured for Due Date Reject if pending by Actual date <date> and the <date> is calculated via a script in a custom action, the approval record becomes No longer required.
3. This is only when the system date format is dd-MM-yyyy
4. It works fine when the date format is yyyy-MM-dd
5. It works fine in NY for any system date format

Steps to Reproduce

1. On any OOB Orlando instance, Go to System Properties > System change the Date format to dd-MM-yyyy > Save
2. Import the attached update set and commit it (even if it shows any error)
3. It contains cat item "SNC TEST ITEM 1" ; Flow "Approval Due Tests" and Action "Return Date and Time"
4. Open "SNC TEST ITEM 1" > Try it > Submit /com.glideapp.servicecatalog_cat_item_view.do?v=1&&sysparm_id=5bcdaeb1db019050016d853339961940
5. Open the RITM (make sure REQ is approved to trigger the flow)
6. After a few seconds, the approval generated for the RITM changes to No Longer Required
7. Go to System Properties > System change the Date format to yyyy-MM-dd > Save
8. Repeat steps 3-6
9. Open the RITM, its approval stays Requested

Workaround

Create a custom action which outputs a string rather than a Date or Date/Time.  Drag the output of the customer action to Due Date field.

In the custom action use the code on these lines:
////////////
(function execute(inputs, outputs) {
var currDate = new GlideDate();
currDate.setValue(inputs.date);
var addDays = parseInt(inputs.days);
currDate.addDaysLocalTime(addDays);
var dateStr = currDate.getByFormat("yyyy-MM-dd").toString();
gs.info(dateStr);
outputs.duedate = dateStr;
})(inputs, outputs);


Related Problem: PRB1410941