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