[quick-event] Add Fantastical-style calendar selector and improve date parsing
Summary
This PR adds several quality-of-life improvements to the Quick Event extension:
-
Calendar selector: Append
/calendarnameto quickly select which calendar to use- Example:
Lunch with Sarah tomorrow /work - Supports fuzzy matching (e.g.,
/wmatches "Work")
- Example:
-
Time range parsing: Ranges like
2-3pmnow work correctly- Before: "piano tuning 2-3pm" → parsed as all-day event with "2" in title
- After: "piano tuning 2-3pm" → correctly parsed as 2:00 PM to 3:00 PM
-
Timezone support: Specify timezone after time
- Example:
Call with NYC team 3pm EST tomorrow - Supports major timezones: EST/EDT, PST/PDT, GMT/UTC, CET, JST, AEST, etc.
- Example:
-
Smart date handling: Past dates auto-advance to next year
- "Dec 18" in late December → Dec 18 next year
Test plan
- [ ] Test calendar selector with
/calendarnamesyntax - [ ] Test fuzzy matching with partial calendar names
- [ ] Test time ranges like
2-3pm,10-11:30am - [ ] Test timezone specification like
3pm EST - [ ] Test past dates auto-advance to next year
🤖 Generated with Claude Code
Thank you for your contribution! :tada:
🔔 @mblode @bascomb @whitespacecode @ridemountainpig you might want to have a look.
You can use this guide to learn how to check out the Pull Request locally in order to test it.
📋 Quick checkout commands
BRANCH="quick-event-calendar-selector"
FORK_URL="https://github.com/alexpriest/extensions.git"
EXTENSION_NAME="quick-event"
REPO_NAME="extensions"
git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev
Due to our current reduced availability, the initial review may take up to 10-15 business days.
Greptile Summary
This PR adds several quality-of-life improvements to the Quick Event extension, bringing it closer to Fantastical's functionality:
-
Calendar selector: Append
/calendarnameto select which calendar to use with fuzzy matching support -
Time range parsing: Ranges like
2-3pmnow work correctly by converting tofrom X to Yformat for Sherlock -
Timezone support: Specify timezone after time (e.g.,
3pm EST) with support for major timezones - Smart date handling: Past dates automatically advance to next year
Key changes:
- Added
fuse.jsfor fuzzy calendar name matching with exact match → prefix match → fuzzy match fallback - Implemented timezone extraction and conversion logic with
TIMEZONE_OFFSETSmapping - Enhanced UI with timezone and matched calendar tags, reordered action panel to prioritize matched calendar
- Updated time range preprocessing to convert
2-3pmpatterns tofrom 2pm to 3pmformat
Issues found:
-
Critical: Timezone conversion logic in
applyTimezone()has incorrect calculation that will produce wrong times
Confidence Score: 3/5
- This PR has a critical timezone conversion bug that will cause incorrect event times
- The implementation is well-structured with good UX improvements, but the timezone conversion logic contains a mathematical error that will produce incorrect event times. This is a functional bug that needs to be fixed before merging. Other than this issue, the code quality is good with proper error handling, fuzzy matching, and sensible fallbacks.
- Pay close attention to
useCalendar.tsx- the timezone conversion logic needs correction
Important Files Changed
| Filename | Overview |
|---|---|
| extensions/quick-event/src/useCalendar.tsx | Added calendar selector with fuzzy matching, timezone support, and smart date handling for past dates |
| extensions/quick-event/src/index.tsx | Updated UI to display matched calendar and timezone tags, reordered action panel to prioritize matched calendar |
| extensions/quick-event/src/dates.ts | Added time range parsing for patterns like "2-3pm" and "2pm-3pm" to improve Sherlock parsing |
| extensions/quick-event/CHANGELOG.md | Existing changelog file, missing entry for current PR changes |