Add option to display day names as headers of calendar week view (#1444)

This commit is contained in:
Sherfin Shamsudeen 2021-11-23 15:46:10 +05:30 committed by GitHub
parent ba89790d0d
commit 72ec5d786d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -73,6 +73,9 @@ export const Calendar = function ({
const components = {
timeGutterHeader: () => <div style={{ height: '100%', display: 'flex', alignItems: 'flex-end' }}>All day</div>,
week: {
header: (props) => <div>{moment(props.date).format(styles.displayDayNamesInWeekView ? 'ddd' : 'DD MMM')}</div>,
},
};
return (

View file

@ -1227,6 +1227,10 @@ export const componentTypes = [
{ name: 'Spacious', value: 'spacious' },
],
},
displayDayNamesInWeekView: {
type: 'toggle',
displayName: 'Display only names of days as headers on week view',
},
},
exposedVariables: {
selectedEvent: {},
@ -1271,6 +1275,7 @@ export const componentTypes = [
styles: {
visibility: { value: '{{true}}' },
cellSizeInViewsClassifiedByResource: { value: 'spacious' },
displayDayNamesInWeekView: { value: true },
},
},
},