27
Views
2
Comments
Solved
[Horizontal Calendar ] Horizontal calender is in error when there is more that one calendar on your screen.
Question
horizontal-calendar
Mobile icon
Forge asset by Hugo Fagundes
Application Type
Mobile

I assume this behaviour come from this piece of JavaScript:

maybe the [0].value only takes 1 refDate per screen, am I correct? 

What can we do to change the behaviour so the calendar could be used a number of times on 1 screen?

I added my example to this question. 

CalendarHorizontalDemo.oml
UserImage.jpg
Cláudio Rodrigues
Solution

Hi Ineke,

Ye, this widget was not prepared to be used multiple times in the same screen.

If you are looking for a way to fix it your self by editing the extension, below you can see my changes recommendations to get it to work.

1. Add an input to the Javascript which holds the ID of container Calendar. And change the code for the follow line:

$parameters.Date = document.querySelector('#' + $parameters.CalendarId + ' .refDate') .value;

2. In the first javascript inside the OnReady action, change the lines 28 and 35 to the following:


	28 - var e = t[0].getElementsByClassName("rescalendar_day_cells")[0];
	35 - $(t).find(".rescalendar_day_cells").html(ss), click(t);
	



Hope it could help.

Regards,

Cláudio

2018-05-03 06-19-54
Ineke de Raaf

thank you very much Cláudio! it works like a charm!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.