matthewchivers / dodl

A cli tool that automates the creation and organisation of structured documents using custom templates; Focus on writing, not setup.
MIT License
1 stars 0 forks source link

[Feature] Natural Language Date Parsing #49

Open matthewchivers opened 1 week ago

matthewchivers commented 1 week ago

Summary

Enable natural language date parsing to allow users to specify dates in a more intuitive way, such as "next Wednesday", "in 3 days", or "tomorrow", or "yesterday" rather than using fixed date formats. This enhancement will make dodl commands more user-friendly by supporting flexible date inputs.

Motivation

Currently, specifying dates requires a strict format DD-MM-YYYY, which can be cumbersome and unintuitive for users. Adding natural language support for dates will streamline the user experience, allowing them to specify dates in everyday language, saving time and reducing potential errors.

Proposed Solution

Integrate a natural language date parser within the command handling logic, which can interpret phrases like "tomorrow," "next week," or specific day names (e.g., "Monday") into accurate date values. This functionality could be achieved through a library or custom parsing logic that recognises common date phrases.

Alternatives Considered

  1. Restrict to Fixed Date Formats: While simpler to implement, this would limit user convenience and require users to remember and adhere to specific date formats.
    • This could be considered as an interim alternative if a suitable implementation/library can't be found.
  2. Limited Date Aliases: Instead of full natural language support, only allowing basic aliases like "today" or "tomorrow" would offer minimal flexibility without fully addressing the user experience goal.

Additional Context

This feature should work consistently across all dodl commands where dates are accepted. It may involve additional validation to ensure accuracy and compatibility with existing date handling logic.

Checklist