摘要:
<script>window.onload = function () { var str = ''; var list = CreateWeekDate('2012-05-01'); for(var i = 0; i < 7; i++) { str += list.date[i] + ' ' + list.week[i] + '\n'; } alert(str);};function CreateWeekDate(date){ var now = date ? new Date(toDate(date)) : 阅读全文
摘要:
Date toLocaleFormat 参数说明 var today= new Date();alert(today.toDateString());alert(today.toLocaleString());alert(today.toLocaleDateString());alert(today.toLocaleFormat("%m/%d/%Y"));Date toLocaleFormat 参数:%m/%d/%Y 示例alert(new Date().toLoacleFormat('%Y-%m-%d')); 阅读全文
摘要:
function showDate(date) { var now = date ? new Date(date) : new Date(); var start = date ? new Date(date) : new Date(); var end = date ? new Date(date) : new Date(); var n = now.getDay(); var result = {}; start.setDate(now.getDate() - n + 1); end.setDate(now.getDate() - n + 7); start = start.getFu.. 阅读全文