UNPKG

506 BJavaScriptView Raw
1export function goStartMonth(time) {
2 return time.clone().startOf('month');
3}
4
5export function goEndMonth(time) {
6 return time.clone().endOf('month');
7}
8
9export function goTime(time, direction, unit) {
10 return time.clone().add(direction, unit);
11}
12
13export function includesTime() {
14 var timeList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
15 var time = arguments[1];
16 var unit = arguments[2];
17
18 return timeList.some(function (t) {
19 return t.isSame(time, unit);
20 });
21}
\No newline at end of file