You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to simplify some templates, and currently I have a section that needs to create a duration and perform some math on it, and output certain fields as seconds. As a result, I need to have my template specify a duration in hours, minutes, and seconds. Once done, I then multiply those to get seconds, and then convert that duration.
Instead, it would be nice to be able to specify a duration and change it.
I wanted to let you know that this issue has been addressed in the fork of this project at go-sprout/sprout. The fix has been implemented starting from version v0.3.0.
With new function toDuration introduced in v0.3.0, the issue should be resolved.
The function is used to convert the string representation of the duration to the time.Duration type.
You can new do this by using the following code snippet:
For those looking for a solution, I recommend checking out the latest releases of the fork. This should help address the issue discussed in this thread.
Attempting to simplify some templates, and currently I have a section that needs to create a duration and perform some math on it, and output certain fields as seconds. As a result, I need to have my template specify a duration in
hours
,minutes
, andseconds
. Once done, I then multiply those to get seconds, and then convert that duration.Instead, it would be nice to be able to specify a duration and change it.
Current way to have to do this: Link to playground
Desired way to do this: Link to playground
The text was updated successfully, but these errors were encountered: