Draft: Improve timezone inference from surrounding blocks

Disclaimer: These changes are tentative and up for discussion. I feel the code as a whole is kind of messy, but trying to handle all the different scenarios gets complex very quickly.

While working on https://phabricator.collabora.com/T62691 (MM upgrade), I noticed two things:

  • We are not running the latest version of this plugin on prod MM;
  • The latest version of this plugin is broken.

Basically, the changes from !23 (merged), made to address texts like today any time before 17:00 CEST - tomorrow before 17:00 CEST, broke the common use case of e.g. 'GMT-'.

This MR:

  • Fixes the logic from the previous MR so it only ignores dashes (-) that are surrounded by whitespace from both sides.
  • Makes the refiner logic that infers timezones from surrounding time locks more robust.

Merge request reports

Loading