- Home
- Forum
- React - EJ 2
- Format date in Month Timeline View
Format date in Month Timeline View
Good morning,
How could I format the date in the header? I tried in many different ways but without success. I'd like to see the month in each cell and not just in the first one.
Thank you,
Matteo Messmer
SIGN IN To post a reply.
3 Replies
1 reply marked as answer
PN
Praveenkumar Narasimhanaidu
Syncfusion Team
October 6, 2021 01:43 PM UTC
Hi Matteo,
Greetings from Syncfusion support..!
We have validated your requirement “Format date in Month Timeline View” and you can achieve it with help of scheduler dateHeaderTemplate. We have also prepared a sample for your reference which can be viewed from the following link.
Sample: https://stackblitz.com/edit/ej2-react-scheduler-timeline-month-date-header-template?file=index.js
Index.js
|
getDateHeaderText(props) {
return this.instance.formatDate(props.date, { skeleton: 'MMMd' });
}
render() {
return (
<div className="schedule-control-section">
<div className="col-lg-12 control-section">
<div className="control-wrapper">
<ScheduleComponent
cssClass="timeline-resource-grouping"
width="100%"
height="650px"
selectedDate={new Date(2021, 3, 4)}
currentView="TimelineMonth"
dateHeaderTemplate={this.getDateHeaderText.bind(this)}
workDays={this.workDays}
eventSettings={{ dataSource: this.data }}
group={{ resources: ['Projects', 'Categories'] }}>
|
For more information about date skeletons and dateHeaderTemplate, please refer to below documentation links.
UG(date skeletons): https://ej2.syncfusion.com/react/documentation/common/internationalization/#date-formatter-and-parser
Demo(dateHeaderTemplate): https://ej2.syncfusion.com/react/demos/#/material/schedule/date-header-template
UG(dateHeaderTemplate): https://ej2.syncfusion.com/react/documentation/schedule/header-bar/#using-date-header-template
Kindly try the above solution and get back to us if you need any further assistance.
Regards,
Praveenkumar
Marked as answer
MA
matteomessmer
April 27, 2022 07:10 PM UTC
I'm sorry, I missed the reply or probably forgot to reply.
Thank you as always!
Best regards,
Matteo Messmer
Hi Matteo,
Thanks for the update.
Please let us know if you need any further assistance.
Regards,
Vengatesh
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
- Marked answer
-
MA matteomessmer
- Oct 5, 2021 09:00 AM UTC
- Apr 28, 2022 03:38 AM UTC