2021-06-17 18:21:48 +03:00
|
|
|
export default function calendarHelper(value) {
|
|
|
|
const startDay = value.clone().startOf('month').startOf('week').startOf('day');
|
|
|
|
const endDay = value.clone().endOf('month').endOf('week');
|
|
|
|
|
|
|
|
const day = startDay.clone().subtract(1, 'day');
|
|
|
|
|
|
|
|
const calendar = [];
|
|
|
|
|
|
|
|
while (day.isBefore(endDay, 'day')) {
|
|
|
|
calendar.push(
|
2021-06-18 17:16:08 +03:00
|
|
|
Array(1)
|
2021-06-17 18:21:48 +03:00
|
|
|
.fill(0)
|
|
|
|
.map(() => day.add(1, 'day').clone())
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return calendar;
|
|
|
|
}
|