You need to sign in to do that
Don't have an account?
canonw
Getting a Date Format for current user?
Does anyone know how to get date format for current user in scontrol?
The reason for date format is date picker. When I assign a date value to date picker, it must be locale oriented. Otherwise, s-control may assign date as DD/MM/YYY, instead of MM/DD/YYYY.
I know UserContext.dateFormat
is the right variable. But I can't find the method to get the value. We have users around the world using several locale. So, hardcode is not an option.
Thanks in advance
var now = new Date();
var year = now.getFullYear() + 2;
var day = now.getDate();
var month = now.getMonth()+ 1;
var closeDate = month + '/' + day + '/' + year;
Account.closeDate__c = closeDate;