Handlebars.Net.Helpers
Handlebars.Net.Helpers copied to clipboard
Support Offset for DateTime.Now (or another helper)
I'm looking to achieve functionality similar to this in https://docs.wiremock.io/response-templating/dates-and-times/
{{now}}
{{now offset='3 days'}}
{{now offset='-24 seconds'}}
{{now offset='1 years'}}
{{now offset='10 years' format='yyyy-MM-dd'}}
WireMock uses this library under the hood.
It would be really useful to be able to add or remove time from the current date. I'm not concerned too much with how the API works just so long as it's possible.
As a proposal, it could work something like this:
{{DateTime.NowOffset offsetInDays='5'}}
Thanks
Maybe you can use Linq?
Like: {{Linq x 'it.AddYears(1)'}}
Cool thanks