raghav
08/10/2021, 5:53 AMfunction startOfWeek()
{
current_date = new Date();
var diff = current_date.getDate()-current_date.getDay()+(current_date.getDay() === 0 ? -6 : 1);
var date = new Date(current_date.setDate(diff));
var WSD = format.format({
value: date,
type: format.Type.DATE
});
return WSD;
}
and even though the log.debug shows a string in MM/DD/YYYY format its still throwing an error.
Have tried multiple snippets for the same task and none of them is returning a value that can be put in the date field of the record.battk
08/10/2021, 5:56 AMbattk
08/10/2021, 5:57 AMbattk
08/10/2021, 6:01 AMraghav
08/10/2021, 6:02 AMbattk
08/10/2021, 6:24 AMraghav
08/10/2021, 6:38 AMbattk
08/10/2021, 6:38 AMbattk
08/10/2021, 6:38 AMbattk
08/10/2021, 6:39 AMraghav
08/10/2021, 7:38 AMbattk
08/10/2021, 7:45 AMdate
or honestly current_date
battk
08/10/2021, 7:45 AMraghav
08/10/2021, 7:56 AMbattk
08/10/2021, 7:59 AMbattk
08/10/2021, 8:00 AMvar date = new Date(current_date.setDate(diff));
they are the same Datebattk
08/10/2021, 8:01 AM