Our powerful JS Calendar component


Post by ravindra patidar »

Hi,

I want to show date range in description renderer so i did this

descriptionRenderer: () => {  
return `${this.startDate} - ${this.endDate}`;
}

But for view where I dont have events this descriptionRenderer is not getting updated. Is their any inbuild functionality which can help me so that I dont have to manually update the date range on descriptionRenderer .

Attachments
Screenshot 2024-03-06 102343.png
Screenshot 2024-03-06 102343.png (46.06 KiB) Viewed 253 times

Post by Animal »

This always updates. It appears that you have a Javascript error there. What is that?


Post by ravindra patidar »

Hi ,
The error is not related to this. Can you please share the code I need to use to show date range in the toolbar.


Post by Animal »

It's the descriptionRenderer. That is what outputs the description which is inserted into the tbar when the view changes or the time range changes.


Post by Animal »

What is this inside that arrow function that you configured it as?

Obviously it is the this of the function which was running when that function was defined. Probably that doesn't have a startDate property?

Screenshot 2024-03-06 at 09.30.38.png
Screenshot 2024-03-06 at 09.30.38.png (426.35 KiB) Viewed 239 times

Post by ravindra patidar »

Right now i am using my local variables (startdate and endDate) but I want to know if their is any way that descriptionRenderer takes the current view startdate and end date by itself.


Post by Animal »

If you don't use an arrow function this will be the view.


Post by Animal »

But the docs say that the view is also passed. In case the string form is used and it's called on another object.

Screenshot 2024-03-06 at 12.51.40.png
Screenshot 2024-03-06 at 12.51.40.png (94.88 KiB) Viewed 224 times

Post Reply