<!-- script代码,如果需要引用js文件,请使用与HTML中相同的方式。 -->
<script type = "text/javascript" >
jQuery(document).ready(function() {
var date = new Date(),
y = date.getFullYear(),
m = date.getMonth();
var firstDay = new Date(y, m, 1);
var lastDay = new Date(y, m + 1, 0);
var first = date1(firstDay);
var last = date1(lastDay);
function date1(date) {
var year = date.getFullYear();
var month = (date.getMonth() + 1).toString();
var day = (date.getDate()).toString();
if(month.length == 1) {
month = "0" + month;
}
var dateTime = year + "-" + month + "-" + day;
return dateTime;
}
//alert(firstDay);
jQuery('#field23034').val(firstDay); //
var f1=firstDay.toString();
jQuery('#field23034span').html(f1); //
//alert(lastDay);
jQuery('#field23035').val(lastDay); //
var last1=lastDay.toString();
jQuery('#field23035span').html(last1); //
});
</script>
泛微-E8-取当前月份的第一天和最后一天
最新推荐文章于 2024-07-29 15:00:38 发布