From Jalali icon

From Jalali

Convert Persian (Jalali) dates to Gregorian calendar

From Jalali

AI-generated

Overview

This node converts Persian (Jalali) dates to the Gregorian calendar. It supports inputting the date either as a complete Persian date string or as separate year, month, and day values. The node then outputs the corresponding Gregorian date in various formats, such as ISO string, timestamp, localized string, and more. This is useful for workflows that need to handle Persian calendar dates and convert them to standard Gregorian dates for further processing or integration.

Use Case Examples

  1. Convert a Persian date string '1402/12/25' to a Gregorian ISO date string for database storage.
  2. Input separate Persian year, month, and day values and get the Unix timestamp for scheduling events.
  3. Convert Persian dates to localized strings for display in user interfaces.

Properties

Name Meaning
Input Type The format of the input date, either a complete Persian date string or separate year, month, and day values.
Date Persian date in YYYY/MM/DD format, used when input type is 'Complete Date'. Can use Persian or English numerals.
Year Persian calendar year, used when input type is 'Separate Values'.
Month Persian calendar month, used when input type is 'Separate Values'.
Day Persian calendar day, used when input type is 'Separate Values'.
Output Format The format of the output Gregorian date, with options to return all formats or specific formats like ISO string, timestamp, localized string, etc.

Output

JSON

  • isoString - Date in ISO 8601 string format
  • timestamp - Date as Unix timestamp in milliseconds
  • timestampSeconds - Date as Unix timestamp in seconds
  • dateString - Date as a human-readable string
  • localizedString - Date in localized string format based on system locale
  • standardString - Date in standard YYYY/MM/DD format
  • utc - Date in UTC string format
  • time - Time portion of the date as a string
  • date - Date in the selected single output format

Dependencies

  • moment-jalaali library for Persian date parsing and conversion

Troubleshooting

  • Ensure the Persian date input is not empty when using 'Complete Date' input type.
  • When using 'Separate Values' input type, year, month, and day must all be provided and non-zero.
  • Input Persian date must be valid and correctly formatted; otherwise, the node throws an 'Invalid Persian date format or values' error.
  • If the node is set to continue on fail, errors will be included in the output JSON under the 'error' property.

Discussion