Hello,
I am trying to set the date of a record using the rbf_updateRecord() function but its staying empty when I use the code below.
var currentDate = new Date(); var arr = []; arr.dateField = currentDate; // Doesn't work rbf_updateRecord("object", id, arr, true, function postUpdateCallback() { alert("Done"); }
When I use the code below it works so I'm thinking its something to do with the format. How can I know the format that I am supposed to set in a portal page?
arr.dateField = "29/06/2016, 15:28"; // Works
Cheers.
Iram
Hi Iram,
Can you retrieve the date format from the localization settings and use rbf_formatDate()?
var locContext = pageContext .getPageLocalization(); var d = locContext.getDateFormat();
var currentDate = new Date(); arr.dateField = rbf_formatDate(currentDate,d); rbf_updateRecord("trmt", {!id}, arr, true, function postUpdateCallback() { alert("Done"); });
Hello [mention:c44119a881b5487780a24bdb227e8dca:e9ed411860ed4f2ba0265705b8793d05] ,
Nope, pageContext is not defined for Portal pages. So anything to do with using rb.newui... etc wouldn't work. Is there any other way of retrieving the date format in Portal pages?
Iram