Skip to content

Commit

Permalink
Updated some times
Browse files Browse the repository at this point in the history
  • Loading branch information
Rockster160 committed Oct 30, 2024
1 parent 30c6e2f commit 9e64017
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/service/jarvis/times.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ def extract_time(words, chronic_opts={})
iso8601_regex = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}-07:00/
time_str = words[/\b(in) (#{drx}|an?) #{time_words_regex}(( and)?( a)?( half)?)?( (and )?#{drx}( #{time_words_regex})?)?/]
time_str ||= words[/\b(in) (#{drx}|an?)( (and )?(a )?half( #{time_words_regex})?)?/]
time_str ||= words[/(\bon )?(#{month_words_regex} \d{1,2}(\w{2})?(,? '?\d{2,4})? )?((in the )?(#{day_words_regex} ?)+ )?\b(at) \d+:?\d*( ?(am|pm))?( (#{day_words_regex} ?)+)?/]
time_str ||= words[/(\bon )?#{month_words_regex} \d{1,2}(\w{2})?(,? '?\d{2,4})?/]
time_str ||= words[/(\bon)(?:^| )?\d{1,2}\/\d{1,2}(\/(\d{2}|\d{4})\b)?/]
time_str ||= words[/(\bon)(?:^| )#{day_words_regex}/]
time_str ||= words[/(\b(?:on|next|last) )?(#{month_words_regex} \d{1,2}(\w{2})?(,? '?\d{2,4})? )?((in the )?(#{day_words_regex} ?)+ )?\b(at) \d+:?\d*( ?(am|pm))?( (#{day_words_regex} ?)+)?/]
time_str ||= words[/(\b(?:on|next|last) )?#{month_words_regex} \d{1,2}(\w{2})?(,? '?\d{2,4})?/]
time_str ||= words[/(\b(?:on|next|last))(?:^| )?\d{1,2}\/\d{1,2}(\/(\d{2}|\d{4})\b)?/]
time_str ||= words[/(\b(?:on|next|last))(?:^| )#{day_words_regex}/]
time_str ||= words[/in the #{day_words_regex}/]
time_str ||= words[/(#{drx}|an?) #{time_words_regex} \b(from now|ago)\b/]
time_str ||= words[/((next|last) )?(#{day_words_regex} ?)+/]
Expand Down

0 comments on commit 9e64017

Please sign in to comment.