serokell / tzbot

Timezone bot for Slack
Mozilla Public License 2.0
7 stars 2 forks source link

Warn the sender when an unrecognized timezone abbreviation is used #70

Closed dcastro closed 1 year ago

dcastro commented 1 year ago

Clarification and motivation

The bot supports time references with time zone abbreviations, e.g. 5am in CST.

As noted in timezone_abbreviations.md, time zone abbreviations (1) are not standardized and (2) can be ambiguous.

For example, there are five different interpretations of CST:

  • Central Standard Time (North America)
  • Central Standard Time (Australia)
  • Central Summer Time (Australia)
  • China Standard Time
  • Cuba Standard Time

Nevertheless, we decided to use a subset of commonly used abbreviations.

However, we should bear in mind that the user might attempt to use an abbreviation we do not support. For this reason, the document above also specifies how the bot is meant to behave when an unrecognized abbreviation is used:

If a user sends a message with a reference to a timezone abbreviation that we don't support / doesn't exist, the bot notifies them of this.

And indeed, issue #1 where the parser was implemented also states:

Timezone abbreviation. For simplicity, we should consider any all-uppercase 2-5 letter word a timezone abbreviation (except AM and PM, of course). Validation of the timezone abbreviation will happen in a separate issue.

However, it looks like the parser was in fact implemented by silently ignoring unrecognized timezone abbreviations. Let's fix that here.

Acceptance criteria