feat: enable VDATE reuse with different formats
Summary
Implemented the ability to reuse VDATE variables with different date formats. Users can now enter a date once and format it multiple times in different ways within the same template.
Problem Solved
Previously, VDATE would store the formatted date string, preventing reuse with different formats. Users had to enter the same date multiple times if they needed it in different formats (e.g., for hierarchical folder structures).
Solution
- Store the parsed date as an ISO string with a special
@date:prefix - Format the date on-demand when referenced
- Maintain backward compatibility for existing templates
Example Usage
{{VDATE:date,YYYY}}/{{VDATE:date,MM}}/{{VDATE:date,DD}}/{{VDATE:date,YYYY-MM-DD}}.md
Enter "today" once, get: 2024/01/15/2024-01-15.md
Use Cases
- Hierarchical folder structures: Organize notes by year/month/day
- Consistent date formatting: Use same date in filename and content
- Meeting notes: Show both formal date and day name
- Natural language benefits: Enter "next week" once, use everywhere
Technical Details
- Dates are stored as
@date:2024-01-15T00:00:00.000Zin the variables map - The
@date:prefix identifies values that need date formatting - Non-prefixed values are used as-is for backward compatibility
- Uses moment.js for date parsing and formatting (via Natural Language Dates plugin)
Testing
- [x] TypeScript compilation successful
- [x] Manual testing with various date formats
- [x] Tested natural language inputs
- [x] Verified backward compatibility
Benefits
- Single input: Enter date once, format many ways
- Flexibility: Any moment.js format works
- Natural language: "today", "next week", etc. work across all uses
- Future-proof: Enables date arithmetic features later (#819)
Fixes #69
🤖 Generated with Claude Code
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated (UTC) |
|---|---|---|---|
| quickadd | ✅ Ready (Inspect) | Visit Preview | Jun 19, 2025 3:15pm |
:tada: This PR is included in version 1.14.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
🚀 Release has been published: v1.14.0