Difficulties persian calendar(Jalali)

hi
persian calendar(Jalali) added in some components like dhtmlxcalendar for me. but in dhtmlxScheduler
i`ve problem in persian calendar.
1- having exclusive names for weekdays and months
2- first day of the week is Saturday.
3- How do I change the number of months of the year, such as February, which is 28 days?
Because it is in the Persian calendar of the second month of 31 days, while it is considered in the Gregorian for 28 days, which causes the whole year to be shed in the persian calendar.
Please advise me for the changes above

1 Like

Hello,
there is no easy way to implement Persian calendar in dhtmlxScheduler, it requires quite an extensive work with the source codes.
You can start by looking into the default date methods of the scheduler:
github.com/DHTMLX/scheduler/blo … r.js#L4330
You can redefine some or all of them from your code.

I think we implemented Persian calendar as a part of a separate project some time ago (it wasn’t included in the official build of the scheduler). The working approach was to implement a class which has all methods of JS Date ( developer.mozilla.org/en-US/doc … jects/Date ) but works in Persian calendar and to replace all ‘new Date’ calls in scheduler codebase with a factory method e.g. ‘createDate(params)’ that could return either a native JS Date or a custom Persian Date object depending on configuration. Once is switched to another Date implementation, scheduler worked pretty much as expected and it could be switched between different calendars in a runtime.

Moth labels could be changed using locales:
docs.dhtmlx.com/scheduler/local … stomlocale

Unfortunately I don’t have more specific instructions, nor can I provide a code we implemented for that project

Hello
thanks for your answer
The items listed in the commentary are for use on the Gantt Chart.
Is your solution for Gantt Chart also used?

Do you mean Scheduler?

As for the Gantt, we also haven’t any ready solution. In general, the implementation will be similar to the provided way for Scheduler.

Hello
I used the mentioned instructions and made the following package.

To use it, you must set the following configuration.

gantt.i18n.setLocale("fa");
gantt.config.jalali = true;

I hope this helps you.

2 Likes

Thank you very much for the package.
I have a question as I’m not a professional.
What I did was that I’ve copied the codebase directory to the public folder in my Laravel project and changed the address of the script and link tags respectively.

I also ran the command:
npm i @yahmat/dhtmlxgantt

And it seems to work perfectly.
Is this all that should be done? And what does the npm command actually do ?

Thanks again.

How can we save the dates in Gregorian and only show them in Jalali ?

How can i use your following configuration in Pro version?