The solution I use for my library (SharepointPlus) is to load the page /_layouts/regionalsetng.aspx?Type=User and to parse it in order to find the different regional settings.
If you're more interested about the Date format selected by the users, then I first search for the LCID (that I found using the regionalsetng.aspx page), and then I use the page "/_layouts/iframe.aspx?cal=1&date=1/1/2000&lcid="+lcid to find the date format. To do so, I parse the page and then:
// the document will contain the full datepicker page, for the January 2000
// search for 3/January/2000
var x = document.querySelector('a[id="20000103"]').getAttribute("href").replace(/javascript:ClickDay\('(.*)'\)/,"$1");
// source : http://stackoverflow.com/questions/7885096/how-do-i-decode-a-string-with-escaped-unicode
var r = /\\u([\d\w]{4})/gi;
x = x.replace(r, function (match, grp) { return String.fromCharCode(parseInt(grp, 16)); } );
x = unescape(x); // eg: 3.1.2000
x = x.replace(/20/, "YY"); // 3.1.YY00
x = x.replace(/00/, "YY"); // 3.1.YYYY
x = x.replace(/03/, "DD"); // 3.1.YYYY
x = x.replace(/3/, "D"); // D.1.YYYY
x = x.replace(/01/, "MM"); // D.1.YYYY
x = x.replace(/1/, "M"); // D.M.YYYY
So x will contain my format (YYYY for 4-digits Year, YY for 2-digits day, MM for 2-digits Month, M for 1-digit Month, DD for 2-digits day, D for 1-digit day).
For example x will return DD/MM/YYYY if you're French.
At the end I can use this format to translate a date, using something like the below (source), or MomentJS, or another Date library:
/**
* Parse a string to a Date
* @param {String} strDate
* @param {String} format Supported format including YYYY, YY, MM, M, DD, D, with - and / separators
* @return {Date|Throw} the JS Date object, or throw Error("Invalid Date") if strDate is invalid
* @compatibility IE9+
* @example
* Date.parseFrom("1/10/2017", "MM/DD/YYYY"); // -> new Date(2017,0,10)
*/
Date.parseFrom=function(strDate, format) {
var year,month,day;
// find the separators
var separator=" ";
if (strDate.indexOf("-") > -1) separator="-";
else if (strDate.indexOf("/") > -1) separator="/";
strDate=strDate.split(separator);
format=format.split(separator);
format.forEach(function(d,i) {
switch(d.charAt(0)) {
case "Y": year=strDate[i]*1; break;
case "M": month=strDate[i]*1-1; break;
case "D": day=strDate[i]*1; break;
}
});
if (year===undefined || month===undefined || day===undefined) throw Error('invalid date');
return new Date(year,month,day);
}