Is it possible to get date and time from logged in user's locale and timezone and compare that date and time with work order status change date?
We dont want user to select future date when changing work order status and our instance is used across globe and servers are in US. Below is the code that i wrote but its not working for our users in Asia region.
load("nashorn:mozilla_compat.js");
importPackage(Packages.psdi.mbo);
importPackage(Packages.psdi.server);
if (mbo!== null )
{
//service.log("********************GLW_WOSTDATE********************************");
var statusdate1 = mbo.getDate("ASOFDATE");
if (statusdate1.getTime() >= MXServer.getMXServer().getDate().getTime())
{
errorkey="BADDATE"; errorgroup="GLWWO";
}
}
#WorkManagement------------------------------
Hardik PAtel
Corning Inc
------------------------------