1
1
import { ObjectItem } from "mendix" ;
2
- import { CalendarProps as ReactCalendarProps , NavigateAction , ViewsProps } from "react-big-calendar" ;
2
+ import { CalendarProps as ReactCalendarProps , Formats , NavigateAction , ViewsProps } from "react-big-calendar" ;
3
3
import { withDragAndDropProps } from "react-big-calendar/lib/addons/dragAndDrop" ;
4
4
5
5
import { CalendarContainerProps } from "../../typings/CalendarProps" ;
@@ -47,6 +47,7 @@ export class CalendarPropsBuilder {
47
47
48
48
build ( ) : DragAndDropCalendarProps < CalendarEvent > {
49
49
const CustomWeek = CustomWeekController . getComponent ( this . visibleDays ) ;
50
+ const formats = this . buildFormats ( ) ;
50
51
const views : ViewsProps < CalendarEvent > = this . isCustomView
51
52
? { day : true , week : true , month : true , work_week : CustomWeek , agenda : true }
52
53
: { day : true , week : true , month : true } ;
@@ -60,6 +61,7 @@ export class CalendarPropsBuilder {
60
61
work_week : this . customCaption
61
62
} ,
62
63
events : this . events ,
64
+ formats,
63
65
localizer,
64
66
resizable : this . props . editable !== "never" ,
65
67
selectable : this . props . enableCreate ,
@@ -106,6 +108,16 @@ export class CalendarPropsBuilder {
106
108
}
107
109
}
108
110
111
+ private buildFormats ( ) : Formats {
112
+ const formats : Formats = { } ;
113
+
114
+ if ( this . props . showEventDate === false ) {
115
+ formats . eventTimeRangeFormat = ( ) => "" ;
116
+ }
117
+
118
+ return formats ;
119
+ }
120
+
109
121
private buildTime ( hour : number ) : Date {
110
122
const time = new Date ( ) ;
111
123
time . setMinutes ( 0 , 0 , 0 ) ;
0 commit comments