-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Helper function datetime does not match documentation #106
Comments
In the meantime you could do a typecast, soon I will build a breaking change version which will include sane template helpers based on https://github.com/drone/funcmap, as this really kills all custom template strings this will be a new tagged release with a major version change. |
Thanks. That sounds good. How do you currently do typecasts in templates? |
Hi @tboerger Same issue than @andreipoe And here is my
Any idea how to cast Thanks! |
Similar issue to #123 (comment) |
The documentation page lists
datetime
as a helper with a single argument, e.g.{{datetime build.started}}
, but the function expects 3 arguments:Looking at the source code in drone/drone-template-lib:template/helpers.go#L62, it looks like
datetime
should be called as, for example,{{ datetime build.started "15:04" "" }}
. Butbuild.started
is an integer anddatetime
expects a float, resulting in the following error when called as previously exemplified:It doesn't currently seem possible to pass a float value to
datetime
, so either a helper should be added to allow create converting integers to floats, or thedatetime
function should allow an integer to be passed in directly.The text was updated successfully, but these errors were encountered: