800 views

Description

When instance has a dateFormat of 'dd/MM/yyyy', the 'Estimated Delivery Date of Complete Order' and 'Delivery Date' on the 'Order Status' (Self Service View) of the request show the date format of 'MM/dd/yyyy' instead.

Steps to Reproduce

This issue is observed in the cases below:

  • The service catalog property "use the sc_layout driven cart macros" (glide.sc.use_cart_layouts) is disabled.
  • You are in the Self Service View.

Steps to reproduce in the Self Service View: 

  1. Log into the Fuji demo instance.
  2. Change the system properties glide.sys.date_format to dd/MM/yyyy.
    (https://demonightlyfuji.service-now.com/sys_properties_list.do?sysparm_query=name%3Dglide.sys.date_format)
  3. Go to existing request (for the base system, look for REQ0000003).
    (https://demonightlyfuji.service-now.com/sc_request_list.do?sysparm_query=number%3DREQ0000003)
  4. Change to Self Service View.
  5. Click the requested item (for example, Dell Precision 690, which is RITM0000006).
    Change the Due Date for the requested item (for example, RITM0000006) to 10/06/2015 (we want 10 June 2015).
  6. Go back to the existing request in step 2 and look at the Self Service View.
    (https://demonightlyfuji.service-now.com/sc_request_list.do?sysparm_query=number%3DREQ0000003)
    Look at the Estimated Delivery Date of Complete Order and Delivery Date.

Displayed result: The display result is 06/10/2015. For dateFormat "dd/MM/yyyy", the date becomes 6 Oct 2015.

Expected result: The result should be 10/06/2015. For dateFormat "dd/MM/yyyy", the date should be 10 June 2015.

Workaround

  1. Go to System UI > UI Pages.
  2. Open the UI page com.glideapp.servicecatalog_checkout_view.
  3. Replace the following lines of code [starting line number: 187]:
<g2:evaluate var="jvar_due_date" expression="
var helper = new GlideappCalculationHelper();
var dueDate = new GlideDateTime(sc_req_item.due_date.getDisplayValue());
var estimatedCompletion = dueDate.getNumericValue();
if (estimatedCompletion > longestDueDate)
longestDueDate = estimatedCompletion;
var smart_description = sc_req_item.cat_item.${prop}.getDisplayValue();
if (smart_description == null || smart_description == '' || smart_description == 'undefined')
smart_description = sc_req_item.cat_item.name;
var display_due_date = helper.longToDate(estimatedCompletion);
estimatedCompletion;" />

          With this code:

<g2:evaluate var="jvar_due_date">
var helper = new GlideappCalculationHelper();
var smart_description = sc_req_item.cat_item.${prop}.getDisplayValue();
if (smart_description == null || smart_description == '' || smart_description == 'undefined')
smart_description = sc_req_item.cat_item.name;

var display_due_date = '--';
var estimatedCompletion = 0;
var reqItemDueDate = sc_req_item.due_date;

if(reqItemDueDate != '' || reqItemDueDate != null)
{
var dueDate = new GlideDateTime(reqItemDueDate);
var timeOffset = dueDate.getTZOffset();
estimatedCompletion = dueDate.getNumericValue();
estimatedCompletion = estimatedCompletion+timeOffset;
if (estimatedCompletion > longestDueDate)
longestDueDate = estimatedCompletion;
display_due_date = helper.longToDate(estimatedCompletion);
}
estimatedCompletion;
</g2:evaluate>
  1. Modify the value of variable "answer" defined in the bold element:

<g2:evaluate var="jvar_delivery_date" expression="
var answer = 'Unknown';
if (longestDueDate != 0) {
var helper = new GlideappCalculationHelper();
answer = helper.longToDate(longestDueDate);
}
answer;" />

To:

<g2:evaluate var="jvar_delivery_date" expression="
var answer = '--';
if (longestDueDate != 0) {
var helper = new GlideappCalculationHelper();
answer = helper.longToDate(longestDueDate);
}
answer;" />

 

Note: If you have customized this UI page, make sure you set replace on upgrade = true or handle your upgrades manually.


Related Problem: PRB648487

Seen In

Eureka Patch 4
Fuji Patch 3
Fuji Patch 8
Fuji Patch 9 Hot Fix 1

Fixed In

Fuji Patch 11
Geneva Patch 1
Helsinki
Istanbul

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2016-06-03 15:26:18
Published:2015-10-01