craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.26k stars 634 forks source link

[FR] use another date picker for other calendar types #5001

Closed vnali closed 3 years ago

vnali commented 5 years ago

Craft CMS calendar is a jquery ui calendar and it only translates calendar for different languages in: https://github.com/craftcms/cms/blob/develop/src/web/assets/datepickeri18n/DatepickerI18nAsset.php but translation is not always useful. some authors don't know Gregorian format well. In other content management systems like Drupal or Wordpress, we can have different calendar systems by patching core or 3rd party modules.

I tried this steps only for demonstration and i was able to show user a Persian calendar.

if (isset($datepickerLanguage)=="fa") {
    $this->css = [
      'persianDatepicker-default.css'
    ];
    $this->js = [
        "persianDatepicker.js",
    ];
}

to DatepickerI18nAsset.php

but there are some problems:

at last i think that is not possible for Craft CMS team to find a robust calendar library for every calendar systems and hard code it in Craft CMS. but maybe it is not a bad idea to:

vnali commented 5 years ago

this feature is kind of related to https://github.com/craftcms/cms/issues/5000. is there any chance to have this feature @brandonkelly?

brandonkelly commented 5 years ago

Yep, also in the works for 3.4.

brandonkelly commented 4 years ago

Pushing this back to 4.0, because it is going to introduce breaking changes.