feat(calendar): natural language time parsing in event title#8505
Open
miaulalala wants to merge 2 commits into
Open
feat(calendar): natural language time parsing in event title#8505miaulalala wants to merge 2 commits into
miaulalala wants to merge 2 commits into
Conversation
When a user types a time or date expression in the event title field, a dismissible suggestion banner appears. Pressing Enter or clicking Apply sets the event time/date and strips the matched text from the title. Pressing Escape or clicking Dismiss hides the banner. Supported patterns: - Time only: "2pm", "14:00", "9am" - Time range: "10:00 - 14:00", "10am to 2pm" - Date (all-day): "July 23", "23.07.26", "07/23/2026" - Date range (all-day): "June 1 to June 3", "June 1-3" - Date + time: "July 23, 4pm", "14.08.2026 19:00" - All day: "all day", "all-day" - Relative: "tomorrow", "next Monday", "this Friday", "in 3 days" - Weekday + time: "next Friday 14:00" Multi-language support via chrono-node locale routing based on the user's Nextcloud language setting (de, fr, es, it, nl, pt, ru, uk, sv, fi, ja, vi, zh-hans, zh-hant, with English fallback). The shared logic lives in TimeSuggestionMixin so both EditSimple and EditFull stay in sync without duplication. Assisted-by: ClaudeCode:claude-sonnet-4-6 Signed-off-by: Anna Larch <anna@nextcloud.com>
94 tests covering: - Null/empty input - All-day, time-only, time-range, date, date-range, datetime types - European date format (DD.MM.YY) priority over built-in parser - Relative expressions: tomorrow, next Monday, this Friday, in 3 days - Weekday + time combos: next Friday 14:00 - Title stripping at leading, mid, and trailing positions - Multi-language: de, fr, es, it, nl, ru, pt, sv, zh_CN with regional code normalisation and unsupported-language fallback Assisted-by: ClaudeCode:claude-sonnet-4-6 Signed-off-by: Anna Larch <anna@nextcloud.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds natural language time/date parsing to the event title field in both the popover (EditSimple) and full (EditFull) editors. When the user types a recognised time or date expression, a dismissible suggestion banner appears below the title input.
Supported patterns:
2pm,14:00,9am10:00 - 14:00,10am to 2pmJuly 23,23.07.26,07/23/2026June 1 to June 3,June 1-3July 23 4pm,14.08.2026 19:00all day,all-daytomorrow,next Monday,this Friday,in 3 days,next weeknext Friday 14:00Multi-language support via chrono-node locale routing based on
getLanguage():de,fr,es,it,nl,pt,ru,uk,sv,fi,ja,vi,zh-hans,zh-hant, with English fallback for unsupported locales.Implementation:
src/services/naturalLanguageTimeParserService.js— parsing logic using chrono-node with a custom European DD.MM.YY parser prepended for prioritysrc/components/Editor/Properties/TimeSuggestion.vue— suggestion banner componentsrc/mixins/TimeSuggestionMixin.js— shared mixin consumed by both editor viewsScreenshot
AI disclosure
This PR was developed with assistance from Claude Code (claude-sonnet-4-6).
Test plan
2pmin the title → suggestion banner appears showing "Set time: 14:00"all day→ banner shows "Mark as all-day event", apply toggles all-dayJune 1 to June 3→ banner shows date range, apply sets both dates as all-daytomorrow 3pm→ banner shows datetime, apply sets date and timenext Monday→ banner shows date, apply sets all-day on that Monday15. Juli→ suggestion appearsnpm run test:unit