Skip to content

Commit

Permalink
Merge pull request #299 from arnaudlecam/master
Browse files Browse the repository at this point in the history
Date formatting for french users
  • Loading branch information
audreyt committed Jan 14, 2016
2 parents 3bbe4a2 + 9e20daf commit 9101570
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions socialcalc-3.js
Original file line number Diff line number Diff line change
Expand Up @@ -5716,10 +5716,10 @@ SocialCalc.DetermineValueType = function(rawvalue) {
value = tvalue.replace(/[\$,]/g, "") - 0;
type = "n$";
}
else if (matches=value.match(/^(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{1,4})\s*$/)) { // MM/DD/YYYY, MM/DD/YYYY
else if (matches=value.match(/^(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{1,4})\s*$/)) { // MM-DD-YYYY, MM/DD/YYYY
year = matches[3] - 0;
year = year < 1000 ? year + 2000 : year;
value = SocialCalc.FormatNumber.convert_date_gregorian_to_julian(year, matches[1]-0, matches[2]-0)-2415019;
value = ((navigator.language).indexOf("fr") === 0) ? (SocialCalc.FormatNumber.convert_date_gregorian_to_julian(year, matches[2]-0, matches[1]-0)-2415019) : (SocialCalc.FormatNumber.convert_date_gregorian_to_julian(year, matches[1]-0, matches[2]-0)-2415019);
type = "nd";
}
else if (matches=value.match(/^(\d{4})[\/\-](\d{1,2})[\/\-](\d{1,2})\s*$/)) { // YYYY-MM-DD, YYYY/MM/DD
Expand Down

0 comments on commit 9101570

Please sign in to comment.