|
Ads by Google
|
|
- --/--/--(--) -
|
|
新しい記事を書く事で広告が消せます。 |
|
javascriptで月末日を取得する関数
|
|
- 2009/10/08(Thu) -
|
|
久々更新。まずはリネージュ日記 メテオが値下がりしてるよ!という事で久しぶりにIN。
// ある月の末日を求める関数 Date.prototype.lastDay = function(){ this.year = this.getYear(); this.month = this.getMonth(); this.year = (this.month == 11) ? this.year + 1 : this.year; this.month = (this.month == 11) ? 0 : this.month + 1; return (new Date(this.year,this.month,0)).getDate(); } // 2009/09/10の月末日を求める lastDay = (new Date(2009,8,10)).lastDay(); 外部jsファイルにしておけばいつでも使えてあら便利>w< |






