feat: add jalali calendar
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
@mohammad-moa could you follow the instructions and sign the CLA in the comment above?
Yeah @vsgoulart , thanks for your attention I'll read and sign the CLA.