Skip to content
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

Add possibility to change date format #27

Closed
phun-ky opened this issue Nov 30, 2016 · 3 comments · Fixed by #54
Closed

Add possibility to change date format #27

phun-ky opened this issue Nov 30, 2016 · 3 comments · Fixed by #54

Comments

@phun-ky
Copy link
Contributor

phun-ky commented Nov 30, 2016

It should be possible to specify date format other than US

@alexcanessa
Copy link
Member

@phun-ky could be related to #23. Definitely a good suggestion.

@alexcanessa
Copy link
Member

We can add functions as template properties, so to evaluate wherever you want to customise.

P.S. The default date format is DD/MM/YYYY right now.

This was referenced Mar 15, 2017
@alexcanessa alexcanessa added this to the Release 0.7.0 milestone Apr 17, 2017
@urbanyeti
Copy link

Several years later but but it took me awhile to figure out how to do this with templates in a .grenrc.js file so I thought I would share what I used to convert DD/MM/YYYY to YYYY/MM/DD

"template": { release: function (placeholders) { var parts = placeholders.date.split("/"); var dt = new Date(parseInt(parts[2], 10), parseInt(parts[1], 10) - 1, parseInt(parts[0], 10)); return '## ' + placeholders.release + ' (' + dt.toISOString().substring(0, 10).replace(/-/g,"/") +")\n" + placeholders.body; } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants