-
Notifications
You must be signed in to change notification settings - Fork 0
Description
In a thread in Vaadin Directory, Hussam Almulhim wrote:
Can I render the Cells, assuming I want to display a different calendar and do the conversion and show the info instead of the Gregorian calendar?
-
The implementation of this addon is based on Vaadin DatePicker, which unfortunately only supports the Gregorian calendar.
-
I did some attempts for implementing Hijrah (Umm Al-Qura) by using months with the "same shape" (for instance, use February 2000 as the basis for Rabi Ul Awal 1444, since both are 29-day months starting on Tuesday). It kinda works, but the API is a mess. Another approach would have been overwriting
_getDaysinvaadin-month-calendarin order to allow arbitrary months.

-
Despite of that, there are everal calculations in
fc-year-calendarthat would also need refactoring. For instance, when navigating using the keyboard, we do an arithmetic operation on the Gregorian date in order to get the next week, next day in week, etc.
YearMonthCalendarAddon/src/main/resources/META-INF/frontend/fc-year-calendar/fc-year-calendar.js
Lines 247 to 253 in 9553ed1
//select the first day in month with the same date of week d = new Date(d.getFullYear(), month, 1); while (d.getDay()!=dayOfWeek) d = adjustDate(d, +1); } else { //select the last day in month with the same date of week d = new Date(d.getFullYear(), month+1, 0); while (d.getDay()!=dayOfWeek) d = adjustDate(d, -1);
Metadata
Metadata
Assignees
Labels
Type
Projects
Status