Skip to content

Instantly share code, notes, and snippets.

@rskull
Created August 5, 2011 17:52
Show Gist options
  • Save rskull/1128098 to your computer and use it in GitHub Desktop.
Save rskull/1128098 to your computer and use it in GitHub Desktop.
今月のカレンダー
onload = function () {
var now = new Date();
var y = now.getFullYear();
var m = now.getMonth();
document.write(y+'年'+m+'月<br>');
for (i=1;i<=31;i++) {
var check = new Date(y, m, i);
if (check.getMonth() == m) {
var d = document.createTextNode(i);
document.body.appendChild(d);
if (i % 7 == 0) {
var b = document.createElement('br');
document.body.appendChild(b);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment