Skip to content

Instantly share code, notes, and snippets.

@renzocastro
Created February 27, 2010 05:03
Show Gist options
  • Save renzocastro/316484 to your computer and use it in GitHub Desktop.
Save renzocastro/316484 to your computer and use it in GitHub Desktop.
ActionScript: getLastDateOfMonth Function
private function getLastDateOfMonth(year:Number, month:Number):Number
{
const maxDateOfMes:Number = 31;
var myDate:Date = new Date(year, month, maxDateOfMes);
return (myDate.getDate() == maxDateOfMes ? maxDateOfMes : maxDateOfMes - myDate.getDate());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment