日期:2014-05-16 浏览次数:20412 次
<input type="text" id="datetime" name="datetime" onchange="get_week(this.value)" value="<%=FStime(date())%>">
<script type="text/javascript">
function get_week(v){
var d = new Date(v.replace(/-/g,"/")),s="";
for(var i=0;i<7;i++){
d.setDate(d.getDate()+(i==0?0:1));
s+=d.toLocaleDateString();
}
alert(s.replace(/年
------解决方案--------------------
月/g,"-").replace(/[^\d-]/g," "));
}
</script>
<input type="text" id="datetime" name="datetime" onchange="get_week(this.value)" value="<%=FStime(date())%>">
<script type="text/javascript">
function get_week(v){
var d = new Date(v.replace(/-/g,"/")),s="";
d.setDate(d.getDate() - d.getDay()+1);//获取周一日期
for(var i=0;i<7;i++){
d.setDate(d.getDate()+(i==0?0:1));
s+=d.toLocaleDateString();
}
alert(s.replace(/年
------解决方案--------------------
月/g,"-").replace(/[^\d-]/g," "));
}
</script>