Skip to content

Add possibility to change date format #27

Closed

Description

@phun-ky

It should be possible to specify date format other than US

Activity

  1. alexcanessa commented on Nov 30, 2016

    @alexcanessa
    Member

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

  2. alexcanessa commented on Mar 12, 2017

    @alexcanessa
    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.

  3. added this to the Release 0.7.0 milestone on Apr 17, 2017
  4. urbanyeti commented on Dec 9, 2021

    @urbanyeti

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions