Introduction
Better Date Parser helps with ****extracting and parsing dates from text strings within your app. It leverages the capabilities of the Luxon and Chrono-node libraries to interpret dates in various formats, languages (locales), and time zones. This plugin is ideal for applications that need to process user-inputted dates, extract dates from unstructured text, or handle dates across different regions and time zones.
Usage Instructions
Client-Side Parsing
- Exposed States:
- The plugin element exposes states that provide the current user's time zone information:
- Current UTC offset
- Current timezone
- The plugin element also exposes the state that provides the parsed list of dates from the properties. This list can be empty if no dates are found.
- Usage:
- Use the exposed states to obtain the user's time zone details, which can be passed to server-side actions.
Server-Side Action
- Configure the Workflow:
- Create a workflow that triggers the **Parse dates (**server-side) action provided by the plugin.
- Set Action Fields:
- Date string: The text containing the date(s) you want to extract.
- Date template: (Optional) A format template if the date format is known.
- Parsed as UTC: Set to "yes" to parse dates in UTC or "no" to use the user's local time zone.
- Locale: Specify the language/locale for parsing (e.g., 'en' for English).
- UTC offset: Use the Current UTC offset exposed state from the plugin element.
- Timezone: Use the Current timezone exposed state from the plugin element.
- Handle the Output:
- The action returns Parsed dates, which can be a single date or a list of dates based on the Return list setting.
- Use the parsed dates for further processing, display, or storage in your application.
Example Workflow
- User Input:
- Allow the user to input text that may contain date information (e.g., a message or a note).
- Trigger Parsing:
- When the user submits the text, trigger the Parse dates action in a workflow.
- Display Results:
- Use the Parsed dates output to display the extracted dates to the user or to perform date-related operations.
Workload Usage
The server-side action uses workload as it runs on the server. This generally costs about 2 WU per action run. If nobody in your app has used this workflow in the last 15 minutes or so, it will take a few seconds to ‘warmup’. After this, it should respond pretty quickly.
Field Details