To Jalali
AI-generatedOverview
This node converts Gregorian dates to the Persian (Jalali/Shamsi) calendar format. It supports inputting dates either as a complete date string or by entering year, month, and day separately. The node is useful for workflows that require date conversion to the Persian calendar, such as localization of date displays, cultural event planning, or data processing involving Persian dates. For example, it can convert a standard ISO date string or separate year/month/day values into a formatted Jalali date string or detailed date components.
Use Case Examples
- Convert an ISO date string from input data to a Jalali date string in a specified format.
- Input separate Gregorian year, month, and day values and output the corresponding Jalali date with additional fields like Persian month name and weekday.
Properties
| Name | Meaning |
|---|---|
| Input Type | Choose how to input the date, either as a complete date string or separate year, month, and day values. |
| Date Value | The complete date string or ISO format date to convert, used when Input Type is 'Complete Date'. |
| Year | Gregorian year value, used when Input Type is 'Separate Values'. |
| Month | Gregorian month number (1-12), used when Input Type is 'Separate Values'. |
| Day | Day of the month (1-31), used when Input Type is 'Separate Values'. |
| Output Format | The format of the output Jalali date string, with several predefined options or a custom format. |
| Custom Format | Custom format string for the output date, used when Output Format is 'Custom Format'. |
| Additional Options | Additional options to customize output such as converting numbers to Persian digits, adding numeric year/month/day fields, adding Persian month name, and adding Persian weekday name. |
| Output Field | The field name in the output JSON where the Jalali date string or data will be stored. |
Output
JSON
- The Jalali date string or formatted date output stored under the user-defined output field name.
jalaliYear- Optional numeric Jalali year if 'Add Numeric Values' is enabled.jalaliMonth- Optional numeric Jalali month if 'Add Numeric Values' is enabled.jalaliDay- Optional numeric Jalali day if 'Add Numeric Values' is enabled.jalaliMonthName- Optional Persian month name if 'Add Month Name' is enabled.jalaliWeekday- Optional Persian weekday name if 'Add Weekday' is enabled.input- The original input JSON data for reference.
Dependencies
- moment-jalaali library for date conversion
Troubleshooting
- Invalid date format errors occur if the input date string is empty, malformed, or uses unsupported formats. Ensure the date string is valid and properly formatted.
- When using separate year, month, and day inputs, at least one must be provided; otherwise, an error is thrown.
- If the date values are invalid (e.g., month > 12 or day > 31), the node throws an error indicating invalid date values.
- If the input date string starts with '{{' and is not resolved, it indicates an unresolved expression; check the input data or expression syntax.
- To avoid errors, ensure the output format string is valid and uses the 'j' prefix for Jalali date parts when using custom formats.