bookingactivities / booking-activities

Wordpress plugin booking system
GNU General Public License v3.0
29 stars 10 forks source link

Persian calendar support (Update Fullcalendar to latest version) #95

Closed drmkhani closed 2 years ago

drmkhani commented 3 years ago

Dear all programmers I need to code a "Persian calendar" instead of the default Gregorian calendar for booking in this plugin. Is there a way to do that? Best wishes to all.

yoancutillas commented 3 years ago

Hello,

The calendar library used by Booking Actvities is FullCalendar 3.10.2 with MomentJS 2.27, so first check if both FullCalendar 3.10.2 and MomentJS 2.27 are available in your locale here:

If they are, you can switch the calendar locale thanks to the "Site Language" option in Settings > General.

drmkhani commented 3 years ago

Thanks very much for your email. It actually is a Persian translation, but not the real Persian calendar. Where can I find the calendar source code to change it?

On Mon, Apr 12, 2021, 1:03 PM yoancutillas @.***> wrote:

Hello,

The calendar library used by Booking Actvities is FullCalendar 3.10.2 with MomentJS 2.27, so first check if both FullCalendar 3.10.2 and MomentJS 2.27 are available in your locale here:

If they are, you can switch the calendar thanks to the "Site Language" option in Settings > General.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bookingactivities/booking-activities/issues/95#issuecomment-817606882, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATTMSP46PZWBCU6KTUSGQDTTIKV4RANCNFSM42VORCBA .

yoancutillas commented 3 years ago

Booking Activities doesn't use the latest FullCalendar version, so first, check if the calendar is correct in its latest version here: https://fullcalendar.io/docs/locale-demo

If not, it would be useful to report it to the author here: https://github.com/fullcalendar/fullcalendar/issues Make sure that the issue doesn't exist yet by making some quick searchs first.

Else, the FullCalendar code used by Booking Activities is in lib/fullcalendar/fullcalendar.min.js And it is enqueued in booking-activities.php L166-L172 : https://github.com/bookingactivities/booking-activities/blob/1.10.1/booking-activities.php#L166-L172

You can find the source code here: https://github.com/fullcalendar/fullcalendar/blob/v3.10.2/dist/fullcalendar.js And the docs here: https://fullcalendar.io/docs/v3#toc (make sure to check the code and the docs of the v3, not v5)

drmkhani commented 3 years ago

Thank you very much sir for your detailed information. I will check it out.

On Mon, Apr 12, 2021, 4:52 PM yoancutillas @.***> wrote:

Booking Activities doesn't use the latest FullCalendar version, so first, check if the calendar is correct in its latest version here: https://fullcalendar.io/docs/locale-demo

If not, it would be useful to report it to the author here: https://github.com/fullcalendar/fullcalendar/issues Make sure that the issue doesn't exist yet by making some quick searchs https://github.com/fullcalendar/fullcalendar/issues?q=is%3Aissue+is%3Aopen+persian first.

Else, the FullCalendar code used by Booking Activities is in lib/fullcalendar/fullcalendar.min.js https://github.com/bookingactivities/booking-activities/tree/1.10.1/lib/fullcalendar And it is enqueued in booking-activities.php L166-L172 : https://github.com/bookingactivities/booking-activities/blob/1.10.1/booking-activities.php#L166-L172

You can find the source code here: https://github.com/fullcalendar/fullcalendar/blob/v3.10.2/dist/fullcalendar.js And the docs here: https://fullcalendar.io/docs/v3#toc (make sure to check the code and the docs of the v3, not v5)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bookingactivities/booking-activities/issues/95#issuecomment-817764807, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATTMSP75KVR24LX3LK77KWDTILQXJANCNFSM42VORCBA .

drmkhani commented 3 years ago

I checked the latest version of the "full-calendar." Thanks for the link you sent to me. It fortunately contains the "fa" locale and it works properly in the demo it has provided. But how can I get the "booking activities" plugin to use this full version? It does not change to my locale despite my wordpress website language which is set to Farsi (Persian).!!!

On Mon, Apr 12, 2021 at 4:52 PM yoancutillas @.***> wrote:

Booking Activities doesn't use the latest FullCalendar version, so first, check if the calendar is correct in its latest version here: https://fullcalendar.io/docs/locale-demo

If not, it would be useful to report it to the author here: https://github.com/fullcalendar/fullcalendar/issues Make sure that the issue doesn't exist yet by making some quick searchs https://github.com/fullcalendar/fullcalendar/issues?q=is%3Aissue+is%3Aopen+persian first.

Else, the FullCalendar code used by Booking Activities is in lib/fullcalendar/fullcalendar.min.js https://github.com/bookingactivities/booking-activities/tree/1.10.1/lib/fullcalendar And it is enqueued in booking-activities.php L166-L172 : https://github.com/bookingactivities/booking-activities/blob/1.10.1/booking-activities.php#L166-L172

You can find the source code here: https://github.com/fullcalendar/fullcalendar/blob/v3.10.2/dist/fullcalendar.js And the docs here: https://fullcalendar.io/docs/v3#toc (make sure to check the code and the docs of the v3, not v5)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bookingactivities/booking-activities/issues/95#issuecomment-817764807, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATTMSP75KVR24LX3LK77KWDTILQXJANCNFSM42VORCBA .

yoancutillas commented 3 years ago

In that case, you can wait until Booking Activities supports FullCalendar v5. It currently uses FullCalendar v3. This upgrade involves a lot of code refactoring, there is no estimated release date for the upgrade for now.

Alternately, you can try to fix the calendar with custom code. I don't know what changes are required, but you might be able to fix it by changing the "fa" locale settings in the booking-activities/lib/fullcalendar/locale-all.js file. Or by changing the calendar settings on the bookacti_calendar_init_data hook (or bookacti_calendar_editor_init_data for the calendar editor)

drmkhani commented 3 years ago

Awesome, thanks! I will try these recommendations and let you know if I have any questions.

On Tue, Apr 20, 2021, 1:19 PM yoancutillas @.***> wrote:

In that case, you can wait until Booking Activities supports FullCalendar v5. It currently uses FullCalendar v3. This upgrade involves a lot of code refactoring, there is no estimated release date for the upgrade for now.

Alternately, you can try to fix the calendar with custom code. I don't know what changes are required, but you might be able to fix it by changing the "fa" locale settings in the booking-activities/lib/fullcalendar/locale-all.js https://github.com/bookingactivities/booking-activities/blob/1.10.1/lib/fullcalendar/locale-all.js file. Or by changing the calendar settings on the bookacti_calendar_init_data https://github.com/bookingactivities/booking-activities/blob/1.10.1/js/booking-method-calendar.js#L189 hook (or bookacti_calendar_editor_init_data https://github.com/bookingactivities/booking-activities/blob/1.10.1/js/templates.js#L712 for the calendar editor)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bookingactivities/booking-activities/issues/95#issuecomment-823101363, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATTMSP4HZS7YOQ424ASJAHDTJU5ZNANCNFSM42VORCBA .

drmkhani commented 3 years ago

Thanks for the guide to the codes. Unfortunately I was not able to change the calendar to a Jalali (Persian) calendar. I think the only way would be to wait until you upgrade to the latest full calendar version. I hope you will do that soon. Thanks.

On Tue, Apr 20, 2021 at 1:19 PM yoancutillas @.***> wrote:

In that case, you can wait until Booking Activities supports FullCalendar v5. It currently uses FullCalendar v3. This upgrade involves a lot of code refactoring, there is no estimated release date for the upgrade for now.

Alternately, you can try to fix the calendar with custom code. I don't know what changes are required, but you might be able to fix it by changing the "fa" locale settings in the booking-activities/lib/fullcalendar/locale-all.js https://github.com/bookingactivities/booking-activities/blob/1.10.1/lib/fullcalendar/locale-all.js file. Or by changing the calendar settings on the bookacti_calendar_init_data https://github.com/bookingactivities/booking-activities/blob/1.10.1/js/booking-method-calendar.js#L189 hook (or bookacti_calendar_editor_init_data https://github.com/bookingactivities/booking-activities/blob/1.10.1/js/templates.js#L712 for the calendar editor)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bookingactivities/booking-activities/issues/95#issuecomment-823101363, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATTMSP4HZS7YOQ424ASJAHDTJU5ZNANCNFSM42VORCBA .

yoancutillas commented 3 years ago

Ok, sorry for that. However, the update involves a lot of code refactoring and testing, so I won't be able to treat that as a bug fix, but as a feature request.

Moreover, if I understand correctly, the Jalali calendar is not yet fully functionnal:

can you confirm?

drmkhani commented 3 years ago

Hi. No it is functional. I recently checked it on their official website in the demo section. The Jalali calendar worked fine. Best regards.

On Mon, Apr 26, 2021, 2:38 PM yoancutillas @.***> wrote:

Ok, sorry for that. However, the update involves a lot of code refactoring and testing, so I won't be able to treat that as a bug fix, but as a feature request.

Moreover, if I understand correctly, the Jalali calendar is not yet fully functionnal:

can you confirm?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bookingactivities/booking-activities/issues/95#issuecomment-826703120, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATTMSP52UFQ7LAPA5LPVO3DTKU3QDANCNFSM42VORCBA .

yoancutillas commented 2 years ago

Released in 1.15.0