zoukankan
html css js c++ java
js 每个月有多少天算法
function
change_date ()
{
var
month
=
document.getElementById('start_month');
var
month_temp
=
month.value.split('月');
var
year
=
document.getElementById('start_year') ;
var
year_temp
=
year.value.split('年');
var
date ;
if
(month_temp[
0
]
==
'
1
'
||
month_temp[
0
]
==
'
3
'
||
month_temp[
0
]
==
'
5
'
||
month_temp[
0
]
==
"
7
"
||
month_temp[
0
]
==
"
8
"
||
month_temp[
0
]
==
"
10
"
||
month_temp[
0
]
==
"
12
"
)
{ date
=
31
;
}
if
(month_temp[
0
]
==
'
4
'
||
month_temp[
0
]
==
'
6
'
||
month_temp[
0
]
==
'
9
'
||
month_temp[
0
]
==
'
11
' )
{
date
=
30
;
}
//
window.alert (month_temp[0]);
if
(month_temp[
0
]
==
'
2
' )
{
if
(year_temp[
0
]
%
100
==
0
)
{
if
(year_temp[
0
]
%
400
==
0
)
{
date
=
29
;
}
else
{
date
=
28
;
}
}
else
{
if
(((year_temp[
0
]
%
100
)
%
4
)
==
0
)
{
date
=
29
;
}
else
{
date
=
28
;
}
}
}
var
temp_date
=
document.getElementById('start_day');
for
(i
=
1
;i
<
date;i
++
)
{
var
add_date
=
document.createElement(
"
OPTION
"
);
add_date.text
=
i
+
'日';
add_date.value
=
i
+
'日';
temp_date.add(add_date);
}
}
查看全文
相关阅读:
IDEA 2018 搭建 Spring MVC helloworld
Intellij IDEA创建Spring的Hello World项目
浅谈finally使用坑。
ArrayList源码分析
Spring依赖注入的四种方式(重点是注解方式)
Spring常用的三种注入方式
interview question
待提高问题
myeclipse svn 在线安装
《SQL 进阶教程》 自连接排序
原文地址:https://www.cnblogs.com/gwazy/p/126331.html
最新文章
【转】ABP使用Mysql数据库
【转】MySQL表名大小写敏感导致的问题
【转】「Chris Richardson 微服务系列」微服务架构的优势与不足
Redis .Net
EF使用MySql DBFirst产品的问题总结
面对对象建模/划分主题域
js中两种定时器,setTimeout和setInterval的区别
一个页面从输入URL到页面加载显示完成,这个过程都发生什么?
apply()与call()的区别
Cookie、session和localStorage、以及sessionStorage之间的区别
热门文章
vue 本地存储数据 sessionStorage
JavaScript的函数声明与函数表达式的区别
前端模块化,AMD与CMD的区别
echarts如何给柱形图的每个柱子设置不同颜色
闭包
prototype 与 proto的关系是什么:
Mybatis报错——Mapped Statements collection already contains value for
mybatis 有中文的官方文档:http://mybatis.org/dtd/mybatis-3-config.dtd标红
Spring MVC+Spring+Mybatis+MySQL(IDEA)入门框架搭建
Idea Maven SpringMVC+Mysql 登录
Copyright © 2011-2022 走看看