npm install moment-business
这是一个 Moment.js 库,允许 Moment 在西方工作周中进行操作:7 天工作周,其中周六和周日为非工作日。
例如,
import business from 'moment-business';
// 如果 moment 是周一至周五,则为 true,否则为 false。
business.isWeekDay(someMoment);
// 增加五个工作日到 Moment。
business.addWeekDays(someMoment, 5);
npm install moment-business
This is a Moment.js library that allows Moment operations for Western work weeks: 7 day weeks where Saturday and Sunday are non-work days.
For example,
import business from 'moment-business';
// true if the moment is Mon-Fri, false otherwise
business.isWeekDay(someMoment);
// Adds five work days to the Moment
business.addWeekDays(someMoment, 5);
The repository is located at github.com/jmeas/moment-business.