Skip to content

[WC-1293]: Calendar event date visibility #1630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/pluggableWidgets/calendar-web/src/Calendar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
<caption>Enable create</caption>
<description />
</property>
<property key="showEventDate" type="boolean" defaultValue="true">
<caption>Show event date range</caption>
<description>Show the start and end date of the event</description>
</property>
<property key="defaultView" type="enumeration" defaultValue="month">
<caption>Initial selected view</caption>
<description>Work week and agenda are only available in custom views</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const defaultProps: CalendarContainerProps = {
minHeight: 400,
maxHeightUnit: "none",
maxHeight: 400,
overflowY: "auto"
overflowY: "auto",
showEventDate: true
};

beforeAll(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,15 @@ export function extractCalendarProps(props: CalendarContainerProps): DragAndDrop
}
};

const formats = props.showEventDate ? {} : { eventTimeRangeFormat: () => "" };

return {
components: {
toolbar: CustomToolbar
},
defaultView: props.defaultView,
events,
formats,
localizer,
resizable: props.editable !== "never",
selectable: props.enableCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface CalendarContainerProps {
view: ViewEnum;
editable: EditableEnum;
enableCreate: boolean;
showEventDate: boolean;
defaultView: DefaultViewEnum;
startDateAttribute?: EditableValue<Date>;
eventDataAttribute?: EditableValue<string>;
Expand Down Expand Up @@ -80,6 +81,7 @@ export interface CalendarPreviewProps {
view: ViewEnum;
editable: EditableEnum;
enableCreate: boolean;
showEventDate: boolean;
defaultView: DefaultViewEnum;
startDateAttribute: string;
eventDataAttribute: string;
Expand Down
Loading