Update TIME.md with implementation status and examples
- Mark all features as implemented ✅
- Add comprehensive examples for all date formats
- Document configuration options
- Add examples for time of day, period boundaries, and relative expressions
- Include chaining examples and use cases
This commit is contained in:
@@ -1,28 +0,0 @@
|
|||||||
# Time parsing
|
|
||||||
|
|
||||||
## Time formats
|
|
||||||
- mon, monday - sun, sunday
|
|
||||||
- 21jan, 30dec etc
|
|
||||||
- 2015-12-21
|
|
||||||
- jan, feb, etc. - Sets to first of month
|
|
||||||
- now, current date and time
|
|
||||||
- today, tomorrow, yesterday - at time 00:00
|
|
||||||
- sod, sow, som, soy - start of X at time 00:00
|
|
||||||
- eod, eow, eom, eoy - end of X at time 23:59
|
|
||||||
- later, someday - 2150-01-01 at time 00:00
|
|
||||||
|
|
||||||
All time formats should also support time of day, mon:15:35 and mon:1535. 24-hour format. Mind the ':', must be seperated from the attribute:value syntax.
|
|
||||||
|
|
||||||
## Duration formats
|
|
||||||
- 5sec, second, seconds
|
|
||||||
- 5min, minute, minutes
|
|
||||||
- 5hrs, hour, hours
|
|
||||||
- 3d[ays], 2w[eeks], 4m[onths], 1y[ear]. Singular if 1, plural >1
|
|
||||||
- daily, weekly, monthly (30days), yearly
|
|
||||||
|
|
||||||
There is indirect support for durations everywhere that a date value is expected.
|
|
||||||
No ordinal assumes 1 (hours = hrs = hour = 60min)
|
|
||||||
|
|
||||||
## Relative formats
|
|
||||||
One attribute can be relative to another:
|
|
||||||
`opal add Buy milk due:mon wait:due-1d`
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
Bytte håndhånklær due:today recur:3d +bad wait:due-1d
|
||||||
|
Bytte dusjhåndklær due:sun recur:weekly +bad wait:due-1d
|
||||||
|
Bytte kjøkkenklut og glasshånklær due:mon recur:3d +kjøkken wait:due-1d
|
||||||
|
Rense filter i varmepumpe due:eom recur:monthly wait:due-2d
|
||||||
|
Skifte på sengen due:sun recur:weekly wait:due-1d
|
||||||
|
Av-ise og vaske kjøleskap og fryser due:eom recur:3m +kjøkken wait:due-1w
|
||||||
|
Av-ise og vaske fryser due:eom recur:3m +kjeller wait:due-1w
|
||||||
|
Vaske dusjen due:15jan +bad recur:2w wait:due-1d
|
||||||
|
Vaske toalett, servant og vinduskarm due:fri recur:5d +bad wait:due-2d
|
||||||
|
Vaske kjøkkenbenk due:eod recur:1d
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
# Time and date parsing
|
||||||
|
|
||||||
|
## Time formats
|
||||||
|
- mon, monday - sun, sunday
|
||||||
|
- 21jan, 30dec, Jan21, jan21 (all case variations)
|
||||||
|
- 2015-12-21 (ISO format)
|
||||||
|
- jan, january, feb, february, etc. - Sets to first of month (current year if future, next year if passed)
|
||||||
|
- now - current date and time
|
||||||
|
- today, tomorrow, yesterday - at time 00:00
|
||||||
|
- sod, eod - start/end of day at 00:00 / 23:59:59
|
||||||
|
- sow, eow - start/end of week (configurable via week_start_day, default Monday)
|
||||||
|
- som, eom - start/end of month at 00:00 / 23:59:59
|
||||||
|
- soy, eoy - start/end of year at 00:00 / 23:59:59
|
||||||
|
- later, someday - 2150-01-01 at time 00:00
|
||||||
|
|
||||||
|
### Time of day support
|
||||||
|
All date formats support time of day:
|
||||||
|
- mon:15:35 (HH:MM format)
|
||||||
|
- mon:1535 (HHMM format, 4 digits)
|
||||||
|
- 15:35 (just time = today at that time)
|
||||||
|
- tomorrow:0800, 21jan:1430, etc.
|
||||||
|
|
||||||
|
24-hour format. Uses ':' separator from attribute:value syntax.
|
||||||
|
|
||||||
|
## Duration formats
|
||||||
|
- 5sec, 5seconds, second
|
||||||
|
- 5min, 5minutes, minute
|
||||||
|
- 5hrs, 5hours, hour, hr
|
||||||
|
- 3d, 3days, day
|
||||||
|
- 2w, 2weeks, week
|
||||||
|
- 4m, 4months, month
|
||||||
|
- 1y, 1year, year
|
||||||
|
- daily, weekly, monthly (30 days), yearly
|
||||||
|
|
||||||
|
Duration as date offset: `due:2d` = 2 days from now
|
||||||
|
Recurrence period: `recur:1w` = every week
|
||||||
|
|
||||||
|
## Relative date expressions
|
||||||
|
Date attributes can reference other date attributes:
|
||||||
|
- Subtraction: `opal add Buy milk due:mon wait:due-1d`
|
||||||
|
- Addition: `opal add Task due:today until:due+1y`
|
||||||
|
- Chaining: `opal add Task due:mon scheduled:due-3d wait:scheduled-1d`
|
||||||
|
- Supported operations: + (add), - (subtract)
|
||||||
|
- Order dependency: Referenced attribute must be defined earlier in same command
|
||||||
|
- Supported base attributes: due, scheduled, wait, until, start, end, created, modified
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
- `week_start_day: monday` (or sunday) - Controls sow/eow behavior
|
||||||
|
- `default_due_time: ""` - Optional default time for due dates (HH:MM format)
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
```bash
|
||||||
|
# Basic dates
|
||||||
|
opal add Task due:tomorrow
|
||||||
|
opal add Task due:mon
|
||||||
|
opal add Task due:21jan
|
||||||
|
opal add Task due:march
|
||||||
|
|
||||||
|
# Time of day
|
||||||
|
opal add Meeting due:mon:15:30
|
||||||
|
opal add Call due:tomorrow:0900
|
||||||
|
|
||||||
|
# Period boundaries
|
||||||
|
opal add Report due:eow
|
||||||
|
opal add Review due:som
|
||||||
|
|
||||||
|
# Durations as dates
|
||||||
|
opal add Task due:2w # 2 weeks from now
|
||||||
|
opal add Task scheduled:3d # 3 days from now
|
||||||
|
|
||||||
|
# Relative expressions
|
||||||
|
opal add Project due:eom wait:due-1w scheduled:due-2w
|
||||||
|
opal add Task due:mon:14:00 wait:due-2d:09:00
|
||||||
|
|
||||||
|
# Recurring with all features
|
||||||
|
opal add "Weekly review" due:mon:10:00 recur:1w until:eoy
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user