Date used in the development of next momen.js record

1, calculate the current date Monday to Sunday

var weekOfday = moment () format ( 'E');. // computing today is the day of the week 
var last_monday = moment () subtract ( weekOfday-1, 'days') format.. ( 'YYYY / MM / DD' ); // date Monday 
var last_sunday = moment () add ( 7-weekOfday, 'days') format ( 'YYYY / MM / DD');.. // date Sunday

  

Guess you like

Origin www.cnblogs.com/wangjae/p/12115237.html