Skip to content

Instantly share code, notes, and snippets.

@leocavalcante
Created June 25, 2012 15:51
Show Gist options
  • Save leocavalcante/2989389 to your computer and use it in GitHub Desktop.
Save leocavalcante/2989389 to your computer and use it in GitHub Desktop.
returns the name of the given month (pt)
(function ( global, undefined ) {
var months = ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'];
function monthName ( month, short ) {
month = parseInt( month ) - 1;
return short && month !== 4 ? months[month].slice( 0, 3 ) : months[month];
}
global.monthName = global.monthName || monthName;
} ( this ));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment