Relative dates
DrevOps\BehatSteps\Steps\Web\DateTrait - Source, Example, Helpers
Convert relative date expressions into timestamps or formatted dates.
Supports values and tables.
Possible formats:
[relative:OFFSET][relative:OFFSET#FORMAT]with:
OFFSET: any format that can be parsed bystrtotime().FORMAT:date()format for additional processing.Examples:
[relative:-1 day]converted to1893456000[relative:-1 day#Y-m-d]converted to2017-11-05
dateRelativeProcessValue()is public API. It and its helpers are static, so a token resolves without a context instance.
Late static binding routes the resolution through adateGetNow()override in the composing context. That override is the supported way to hold the current time constant.
Skip processing with tag:@behat-steps-skip:DateTrait.
Options
| Option | Type | Default | Tag | Description |
|---|---|---|---|---|
date.enabled | boolean | TRUE | @behat-steps-skip:DateTrait | Replace [relative:...] tokens in step arguments and table cells. Turn it off to pass a token through to a step untouched. |