2018.2 changes the default date format in account ...
# suitescript
j
2018.2 changes the default date format in account preferences to
M/D/YYYY
. Since (in my experience) SuiteScript 2.0 requires you to set date fields using a Date object created from a string in the account preferred date format, this could be a breaking change for scripts that set date values. Because of the above, I was using a function to detect the user account preference and format the date accordingly
var fmt = runtime.getCurrentUser().getPreference({ name: 'DATEFORMAT' });
but this returned
fmMM/DDfm/YYYY
instead
M/D/YYYY
, which broke my script anyway.