We are making some javascript heavy pages in visualforce, which uses Remoting and Date-time fields. We need to get Date/time format salesforce is using internally in native Datepickers on object detail/edit/etc pages. Seems these date/time formats are not available to query from anywhere.
Based on some findings, we are left with one way to create a map of local > format, as described in this post below:
http://www.interactiveties.com/b_locale_datetime.php#
Or, we could hack into salesforce and use private Javascript API i.e.
var sfdcDateFormat = UserContext.dateFormat;
var sfdcDateTimeFormat = UserContext.dateTimeFormat;
// use above variables in various Javascript datepickers and framework code as needed.
Latest "UserContext" based approach is not safe as its private API, and defining a locale map requires us to know and match all locale <> date formats with salesforce.
Anyone having a better/clean solution for this ?