Skip to content

Instantly share code, notes, and snippets.

@evaisse
Created September 13, 2010 10:11
Show Gist options
  • Save evaisse/577087 to your computer and use it in GitHub Desktop.
Save evaisse/577087 to your computer and use it in GitHub Desktop.
/**
* 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