# What this PR does
If an OnCall template needs to contain a date relative to a date in the
alert response, currently there is no way for the template to add or
subtract time from a parsed date.
This PR adds a function that allows a time-window (e.g., 1s, 5m, 6h, 7d,
2w) to be converted into a Python timedelta, which can then be added or
subtracted from a datetime. An example usage might be:
```
{% set delta = alert.timeWindow | timedeltaparse %}
{% set time = alert.startsAt | iso8601_to_time - delta | datetimeformat('%s') %}
```
## Checklist
- [X] Unit, integration, and e2e (if applicable) tests updated
- [X] Documentation added (or `pr:no public docs` PR label added if not
required)
- [X] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will show up in the
autogenerated release notes.
|
||
|---|---|---|
| .. | ||
| .config | ||
| e2e-tests | ||
| pkg | ||
| src | ||
| tools/eslint-rules | ||
| .bra.toml | ||
| .dockerignore | ||
| .eslintignore | ||
| .eslintrc.js | ||
| .gitignore | ||
| .prettierrc.js | ||
| .stylelintrc | ||
| CHANGELOG.md | ||
| Dockerfile.dev | ||
| go.mod | ||
| go.sum | ||
| jest.config.js | ||
| jest.setup.ts | ||
| knip.json | ||
| LICENSE | ||
| Magefile.go | ||
| package.json | ||
| playwright.config.ts | ||
| pnpm-lock.yaml | ||
| README.md | ||
| tsconfig.json | ||
| webpack.config.ts | ||
Grafana OnCall
Developer-Friendly Alert Management with Brilliant Slack Integration
- Connect monitoring systems
- Collect and analyze data
- On-call rotation
- Automatic escalation
- Never miss alerts with calls and SMS