mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
fix: calendar block not displaying events on boundary dates (#6463)
* fix: calendar block not displaying events on boundary dates * fix: bug
This commit is contained in:
parent
982c6fd5bf
commit
34528c4b0c
@ -153,9 +153,6 @@ export const DatePicker: ComposedDatePicker = (props: any) => {
|
||||
return disabledTime;
|
||||
});
|
||||
};
|
||||
|
||||
console.log(disabledDate);
|
||||
|
||||
const newProps = {
|
||||
utc,
|
||||
...props,
|
||||
|
@ -132,8 +132,8 @@ const useEvents = (
|
||||
const intervalTime = end.diff(start, 'millisecond', true);
|
||||
|
||||
const dateM = dayjs(date);
|
||||
let startDate = dateM.clone().startOf('month');
|
||||
let endDate = startDate.clone().endOf('month');
|
||||
const startDate = dateM.clone().startOf('month');
|
||||
const endDate = startDate.clone().endOf('month');
|
||||
|
||||
/**
|
||||
* view === month 时,会显示当月日程
|
||||
@ -141,16 +141,16 @@ const useEvents = (
|
||||
* 假设 10.1 号是星期六,我们需要将日程的开始时间调整为这一周的星期一,也就是 9.25 号
|
||||
* 而结束时间需要调整为 10.31 号这一周的星期日,也就是 10.5 号
|
||||
*/
|
||||
if (view === 'month') {
|
||||
startDate = startDate.startOf('week');
|
||||
endDate = endDate.endOf('week');
|
||||
}
|
||||
// if (view === 'month') {
|
||||
// startDate = startDate.startOf('week');
|
||||
// endDate = endDate.endOf('week');
|
||||
// }
|
||||
|
||||
const push = (eventStart: Dayjs = start.clone()) => {
|
||||
// 必须在这个月的开始时间和结束时间,且在日程的开始时间之后
|
||||
if (
|
||||
eventStart.isBefore(start) || // 开始时间早于 start
|
||||
(!eventStart.isBetween(startDate, endDate) && !end.isBetween(startDate, endDate)) // 开始时间和结束时间不在月份范围内
|
||||
(!eventStart.isBetween(startDate, endDate, null, '[]') && !end.isBetween(startDate, endDate)) // 开始时间和结束时间不在月份范围内
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user