guoyaxu
posts - 1, comments - 0, trackbacks - 0, articles - 1
BlogJava
::
首頁
::
新隨筆
::
聯系
::
聚合
::
管理
javascript 日期
Posted on 2007-03-02 12:12
江海魚
閱讀(77)
評論(0)
編輯
收藏
所屬分類:
javascript
?
function
?leapYear(year)
{
if
?(year?
%
?
400
?
==
?
0
)?
return
?
true
;
if
?(year?
%
?
4
?
==
?
0
?
&&
?year?
%
?
100
?
!=
?
0
)?
return
?
true
;
return
?
false
;
}
function
?validDate(year,?month,?date)
{
year?
=
?parseInt(year);
month?
=
?parseInt(month);
date?
=
?parseInt(date);
if
?(isNaN(year)?
||
?isNaN(month)?
||
?isNaN(date))?
{
return
?
false
;
}
if
?(year?
<
?
1
?
||
?month?
<
?
1
?
||
?month?
>
?
12
?
||
?date?
<
?
1
?
||
?date?
>
?
31
)?
{
return
?
false
;
}
if
?(month?
==
?
2
?
&&
?date?
==
?
29
)?
{
return
?leapYear(year);
}
if
?(month?
==
?
4
?
||
?month?
==
?
6
?
||
?month?
==
?
9
?
||
?month?
==
?
11
)?
{
return
?(date?
<=
?
30
);
}
return
?(month?
!=
?
2
?
||
?date?
<=
?
28
);
}
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
Powered by:
BlogJava
Copyright © 江海魚
日歷
<
2025年7月
>
日
一
二
三
四
五
六
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
常用鏈接
我的隨筆
我的評論
我的參與
留言簿
(1)
給我留言
查看公開留言
查看私人留言
隨筆分類
java
javascript(1)
隨筆檔案
2007年3月 (1)
文章分類
javascript(1)
文章檔案
2007年3月 (1)
新聞檔案
2007年2月 (5)
相冊
myphoto
收藏夾
Oracle(2)
搜索
最新評論
主站蜘蛛池模板:
资源县
|
揭阳市
|
固原市
|
禹城市
|
新野县
|
日土县
|
开远市
|
林西县
|
白城市
|
卢氏县
|
安仁县
|
保山市
|
元谋县
|
三台县
|
萨迦县
|
平南县
|
祁东县
|
泰州市
|
阿拉善盟
|
天镇县
|
莎车县
|
汤阴县
|
壶关县
|
永登县
|
太湖县
|
屏东市
|
桂阳县
|
疏勒县
|
哈尔滨市
|
静宁县
|
宝清县
|
陆河县
|
河东区
|
鸡东县
|
资溪县
|
鹰潭市
|
黄平县
|
古蔺县
|
泸定县
|
兴义市
|
洪雅县
|