Created
September 13, 2010 10:11
-
-
Save evaisse/577087 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* get French date | |
* | |
* @example | |
* frenchDate(); // Lundi 13 Octobre | |
* | |
* @param date {Date} a date object, if none provided, now() is used | |
* @returns {String} | |
*/ | |
function frenchDate(date) { | |
var months = [ | |
'Janvier', | |
'Février', | |
'Mars', | |
'Avril', | |
'Mai', | |
'Juin', | |
'Juillet', | |
'Août', | |
'Septembre', | |
'Octobre', | |
'Novembre', | |
'Décembre' | |
]; | |
var days = [ | |
'Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi' | |
]; | |
date = date ? date : new Date(); | |
return days[date.getDay()] | |
+ ' ' + date.getDate() | |
+ ' ' + months[date.getMonth()]; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment