Skip to content

Instantly share code, notes, and snippets.

@rskull
Created October 30, 2011 17:49
Show Gist options
  • Save rskull/1326182 to your computer and use it in GitHub Desktop.
Save rskull/1326182 to your computer and use it in GitHub Desktop.
今月の最終日を取得する
//今月の最終日取得
function lastday () {
var now = new Date();
var y = now.getFullYear();
var m = now.getMonth();
for (i=27;i<=32;i++) {
var check = new Date(y, m, i);
if (check.getMonth() != m) {
return i - 1;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment