FFS - Chrono Parser

Parses natural language date/time into structured dates

Overview

This node parses natural language date/time expressions into structured ISO date strings. It leverages a natural language date parser to interpret phrases like "next Friday" or "from today to Monday" and converts them into standardized date formats.

Common scenarios include:

  • Automating workflows that depend on user-friendly date inputs.
  • Extracting start dates or date ranges from text for scheduling or reminders.
  • Converting loosely formatted date descriptions into machine-readable timestamps.

For example, given the input "next Friday", the node outputs the ISO string for that date at the start of the day. For "from today to Monday", it can output a date range with both start and end dates.

Properties

Name Meaning
Input Text The natural language date/time expression to parse, e.g., "next Friday", "from today to Monday". This is required.
Output Type Determines the format of the output:
- Single Date (Start of Day): Outputs one ISO date string.
- Date Range (Start and End): Outputs an array with start and end ISO date strings.
- Auto (Range if Both Start/end Exist): Automatically outputs a range if both start and end dates are detected; otherwise, outputs a single date. Default is Auto.

Output

The node outputs JSON objects with the following structure:

{
  "text": "<original input text>",
  "result": "<parsed date or date range>"
}
  • text: The original input string provided by the user.
  • result: Depending on the selected output type, this is either:
    • A single ISO 8601 date string representing the start of the parsed date.
    • An array of two ISO 8601 date strings representing the start and end of the parsed date range.
    • Null if no valid date could be parsed.

The dates are normalized to the start of the day (00:00:00).

The node does not output binary data.

Dependencies

  • Uses the external library chrono-node for natural language date parsing.
  • No special API keys or credentials are required.
  • Requires the node environment to have access to the chrono-node package.

Troubleshooting

  • No date parsed (null result): If the input text cannot be interpreted as a date or date range, the result will be null. Ensure the input text is a recognizable natural language date expression.
  • Unexpected output format: Verify the "Output Type" property matches your expected output. For example, selecting "Single Date" will never return a range.
  • Timezone considerations: Dates are set to the start of the day in local time before converting to ISO strings. Be aware of timezone differences when using the output.
  • Empty input: Providing an empty string or invalid text will result in no parsed date.

Links and References

Discussion