mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
How to get date in handlebar template 'yyyy-MM-dd' format #652
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jusski on GitHub (Dec 20, 2024).
Originally assigned to: @StefH on GitHub.
If i set mapping to return date in "yyyy-MM-dd" format
im getting back wrong date format:
{ "date": "2024-12-20T00:00:00" }Tried Scriban transformer too, with same results
@StefH commented on GitHub (Dec 21, 2024):
It should be
"TransformerType": "Handlebars", however Handlebars should be take as default value.I did test it in a unit test and it seems to work fine. Can you provide the complete mapping and the code how you use it?
@jusski commented on GitHub (Dec 21, 2024):
Seems like i need to add option:
"TransformerReplaceNodeOptions": "EvaluateAndKeep"And now it will not evaluate '2024-12-20' string value after transforming as date primitive again
Full example with added 'TransformerReplaceNodeOptions is: