HI There
I am receiving an invalid date format error on a Suitelet on the Post part of the script:
I had assumed that maybe the formattedDate variable was returning a string instead of a date value so tried to use format.parse. However, this returns both date and time
var currentDate = new Date();
var formattedDate = format.format({
value: currentDate,
type: format.Type.DATE,
timezone:format.Timezone.PACIFIC_AUCKLAND
});
log.debug("formattedDate", formattedDate);
var parsedDate= format.parse({
value: "18/04/2024",
type: format.Type.DATE
});
log.debug("parsedDate",parsedDate)
Why is the parseDate variable returning date/time instead of just date?
The user and company preferences are both for date to be displayed as "DD/MM/YYYY"
thanks