A TimeReference should always contain a "time of day", which can be expressed using a 12-hour format:
Does 10am work for you?
That doesn't work for me, what about 10:30 AM?
Or a 24-hour format:
I can only be there at 16:00
It may also contain a reference to a certain day.
That reference can be expressed as:
"today" / "tomorrow" / "yesterday"
10am tomorrow
today at 3pm
a number of days from today
10am in 2 days
a day of the week
tuesday at 3pm
at 3pm on tuesday
a day of the month
at 11am on the 4th
a day of the month + a month
at 11am on the 4th of April
at 11am on April 4
at 11am on 4 April
It may also contain a reference to a certain timezone or timezone abbreviation or offset.
Timezone. See tzNameLabelMap for a list of all available timezone names.
9am in europe/london
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.
2pm CST
Offset.
10am UTC+03:00
10am UTC+3
A slack message may contain more than one reference, e.g.:
Let's meet between 10am and 11:30am
Acceptance criteria
The parseTimeRefs function has been implemented and is able to parse the examples above.
We don't need to be able to support all examples in one go - it's fine to submit a PR with support for some cases, and then iterate on that.
Clarification and motivation
We need to be able to parse references to points in time from Slack messages.
See the
parseTimeRefs
andTimeReference
A
TimeReference
should always contain a "time of day", which can be expressed using a 12-hour format:Or a 24-hour format:
It may also contain a reference to a certain day.
That reference can be expressed as:
It may also contain a reference to a certain timezone or timezone abbreviation or offset.
tzNameLabelMap
for a list of all available timezone names.AM
andPM
, of course). Validation of the timezone abbreviation will happen in a separate issue.A slack message may contain more than one reference, e.g.:
Acceptance criteria
parseTimeRefs
function has been implemented and is able to parse the examples above.