Skip to content

Commit c346e6d

Browse files
feat(calendar-web): add showEventDate property to control event date visibility
1 parent 4c040b2 commit c346e6d

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

packages/pluggableWidgets/calendar-web/src/Calendar.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@
8383
<caption>Enable create</caption>
8484
<description />
8585
</property>
86+
<property key="showEventDate" type="boolean" defaultValue="true">
87+
<caption>Show event date range</caption>
88+
<description>Show the start and end date of the event</description>
89+
</property>
8690
<property key="defaultView" type="enumeration" defaultValue="month">
8791
<caption>Initial selected view</caption>
8892
<description>Work week and agenda are only available in custom views</description>

packages/pluggableWidgets/calendar-web/src/utils/calendar-utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,15 @@ export function extractCalendarProps(props: CalendarContainerProps): DragAndDrop
124124
}
125125
};
126126

127+
const formats = props.showEventDate ? {} : { eventTimeRangeFormat: () => "" };
128+
127129
return {
128130
components: {
129131
toolbar: CustomToolbar
130132
},
131133
defaultView: props.defaultView,
132134
events,
135+
formats,
133136
localizer,
134137
resizable: props.editable !== "never",
135138
selectable: props.enableCreate,

packages/pluggableWidgets/calendar-web/typings/CalendarProps.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export interface CalendarContainerProps {
4040
view: ViewEnum;
4141
editable: EditableEnum;
4242
enableCreate: boolean;
43+
showEventDate: boolean;
4344
defaultView: DefaultViewEnum;
4445
startDateAttribute?: EditableValue<Date>;
4546
eventDataAttribute?: EditableValue<string>;
@@ -80,6 +81,7 @@ export interface CalendarPreviewProps {
8081
view: ViewEnum;
8182
editable: EditableEnum;
8283
enableCreate: boolean;
84+
showEventDate: boolean;
8385
defaultView: DefaultViewEnum;
8486
startDateAttribute: string;
8587
eventDataAttribute: string;

0 commit comments

Comments
 (0)