Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for non-gregorian calendars #20

Open
javier-godoy opened this issue Oct 12, 2022 · 0 comments
Open

Add support for non-gregorian calendars #20

javier-godoy opened this issue Oct 12, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@javier-godoy
Copy link
Member

javier-godoy commented Oct 12, 2022

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 _getDays in vaadin-month-calendar in order to allow arbitrary months.
    image

  • Despite of that, there are everal calculations in fc-year-calendar that 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.

    //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);

@javier-godoy javier-godoy added the enhancement New feature or request label Oct 12, 2022
@paodb paodb moved this to Under consideration in Flowing Code Addons May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Under consideration
Development

No branches or pull requests

1 participant