Created
October 30, 2011 17:49
-
-
Save rskull/1326182 to your computer and use it in GitHub Desktop.
今月の最終日を取得する
This file contains hidden or 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
//今月の最終日取得 | |
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