7月以后的日期格式化问题。显示的日期是每周格式。任何帮助将是非常appreciated.the日期是工作的罚款预期日期格式问题。 js jquery
$(document).ready(function() {
var curr = new Date; // get current date
var first = curr.getDate() - curr.getDay(); // First day is the day of the month - the day of the week
var last = first + 6; // last day is the first day + 6
var startDate = new Date(curr.setDate(first));
startDate = ((startDate.getMonth() + 1) < 10 ? '0'
: '')
+ (startDate.getMonth() + 1)
+ "/"
+ ((startDate.getDate() < 10 ? '0' : '') + startDate
.getDate())
+ "/"
当你在JavaScript原生的Date对象的工作,你需要做一些额外的计算。 如果您正在使用[Moment.js](https://momentjs.com/)库,它们并不是必不可少的。它使你的开发更加舒适。 因此,如果您打算在这个或其他项目中进一步处理日期操作,我建议您现在开始使用[Moment.js](https://momentjs.com/)。 – alexfrize