jkabot
03/15/2019, 2:33 PMnew Date(datestring)
where datestring is formatted MM/DD/YYYY.stalbert
03/15/2019, 2:34 PMdatestring
as a implementation defined format?stalbert
03/15/2019, 2:34 PMnew Date()
to accept whatever values any ES5.1 environment would.jkabot
03/15/2019, 2:36 PMrec.setValue
or press rec.save()
Based on the error messages I remember, the Rhino backend would create different java classes for Dates created from different string formats, and the internal NS API expected a specific java class.stalbert
03/15/2019, 2:43 PMstalbert
03/15/2019, 2:44 PMjkabot
03/15/2019, 2:45 PMYou have entered an Invalid Field Value org.mozilla.javascript.NativeDate@5f0736f for the following field: custbody_tpm_ship_by
bharath64
03/15/2019, 2:47 PMjkabot
03/15/2019, 2:53 PMN/format
which is supposed to respect the user/account preference
var origFmtString = '2019-03-15T14:42:52.022Z';
var origFmtDate = new Date(origFmtString);
var accountFmtString = format.format({ type: format.Type.DATE, value: origFmtDate });
jkabot
03/15/2019, 2:56 PMfunction datestr(d) {
var fmt = runtime.getCurrentUser().getPreference({
name: 'DATEFORMAT'
});
var m = moment.utc(d);
return m.isValid() ? m.format(fmt) : '';
}
cja
03/15/2019, 3:23 PMjkabot
03/15/2019, 3:41 PM