You need to sign in to do that
Don't have an account?
jmasl7
Formatting Dates in S-Controls
In developing an S-Control I'm trying to do a combination of the following:
1) output certain Date values to the web page, formatting them according to the user's SF.com locale settings
2) fill in AND accept back Date values from editable Text Boxes (within HTML forms), again formatting these dates according to the user's SF.com locale settings
Questions are:
1) how can my S-Control (i.e. my javascript code) determine what the user's locale settings are?
2) having determined these, how can I convert date values to/from the user-visible format in a sensible way? i.e. is some kind of callable function available rather than just coding stuff like
if (locale == "English (United Kingdom)") {
dateSeparator = "/";
dateFormat = "dmy";
}
else if (locale == "English (United States)") {
dateSeparator = "/";
dateFormat = "mdy";
}
etc. etc.
Seems to me I'd be 'reinventing the wheel' if I did stuff like that - and it would also be a headache regarding testing and future maintainability.
Is there a better way to do this?
Regards
John Lewis
in your other scontrol by using the INCLUDE tag, eg:
{!INCLUDE($Scontrol.my_scontrol)}
HTHs,