Skip to content

Conversation

mohammad-moa
Copy link

@mohammad-moa mohammad-moa commented Jul 4, 2025

In this PR, Jalali calendar has been added using a side library related to flatpickr called flatpickr-jalali-support.

To use it, you must use locale: 'fa' in the Datetime.js file in the path
packages/form-js-viewer/src/render/components/form-fields/Datetime.js

Similarly, in the Datepicker.js component in the path
packages/form-js-viewer/src/render/components/form-fields/parts/Datepicker.js
import Persian

import { Persian } from 'flatpickr-jalali-support/dist/l10n/fa';

the config variable must be used as follows

    let config = {
      allowInput: true,
      dateFormat: getLocaleDateFlatpickrConfig('fa'),
      static: true,
      clickOpens: false,
      locale: Persian,
      // TODO: support dates prior to 1900 (https://github.com/bpmn-io/form-js/issues/533)
      minDate: disallowPassedDates ? 'today' : '01/01/1900',
      errorHandler: () => {
        /* do nothing, we expect the values to sometimes be erroneous and we don't want warnings polluting the console */
      },
    };

Also to display the input placeholder, you should use

getLocaleReadableDateFormat('fa')

Related to issue

@CLAassistant
Copy link

CLAassistant commented Jul 4, 2025

CLA assistant check
All committers have signed the CLA.

@vsgoulart
Copy link
Contributor

@mohammad-moa could you follow the instructions and sign the CLA in the comment above?

@mohammad-moa
Copy link
Author

Yeah @vsgoulart , thanks for your attention
I'll read and sign the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants