Fix influxdb date range formatting

While tackling use case 'now-6h-1d', it seems better to use

`replace` instead of `substring(4)`

possible logic error:

`- 6h + now` -> substring(4) may generates wrong syntax
`now - 6h - 1d` -> substring(4) will create `- 6h - 1d`
`now-6h - 1d` -> substring(4) will create `6h - 1d`