Javascript functions are not working in OSB console
I want to date 1. 10 days to the current date and format it as : 19 Sep, 2022.
Both of the below methods are not working. Is there any other options?
Method 1:
I added action: javascript and added below lines:
date = new Date();
const day = date.toLocaleString('default', { day: '2-digit' });
const month = date.toLocaleString('default', { month: 'short' });
const year = date.toLocaleString('default', { year: 'numeric' });
process.vFormattedSoftDeleteDate = "".concat(day,' ',month,',',year);
JSFiddle: 19 Sep, 2022
OSB Console : September 19, 2022 2:44:44 PM EDT.
Method 2:
var date = new Date();
var options = { year: 'numeric', month: 'short', day: 'numeric' };
process.formatedDate = date.toLocaleString('en-US', options);
jsfilddle : "Sep 19, 2022" , osb console : September 19, 2022 4:45:39 PM EDT