Skip to content

Commit

Permalink
Make sure detected month in search is not part of a word
Browse files Browse the repository at this point in the history
  • Loading branch information
pakerwreah committed Dec 18, 2024
1 parent 673c4da commit 13120b9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Calendr/Main/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,9 @@ class MainViewController: NSViewController {
guard var range = text.range(of: month, options: [.caseInsensitive, .diacriticInsensitive]) else {
return nil
}
guard range.upperBound == text.endIndex || !text[range.upperBound].isLetter else {
return nil
}
components.month = index + 1

// Extract year if it exists after the month
Expand Down

0 comments on commit 13120b9

Please sign in to comment.