Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-20151

Allow customizing date format in changes token

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Currently, the CHANGES... tokens don't allow customizing the date format. This produces weird looking ISO-8601(ish) dates with fractional seconds (at least with Subversion plugin).

      Please allow customizing date formats for these tokens.

      On a related note, the source code for ChangesSinceLastBuildContent does not explain why it uses unreliable-looking reflection and the getDate() function, when there's getTimestamp defined in core.

        Attachments

          Activity

          Hide
          slide_o_mix Alex Earl added a comment -

          I don't know why its not using the getTimestamp method, this token was written before I took over the plugin. I'll look into it. Would you just want to have support for the format of SimpleDateFormat?

          Show
          slide_o_mix Alex Earl added a comment - I don't know why its not using the getTimestamp method, this token was written before I took over the plugin. I'll look into it. Would you just want to have support for the format of SimpleDateFormat?
          Hide
          danielbeck Daniel Beck added a comment -

          SimpleDateFormat would be perfect, yes.

          Show
          danielbeck Daniel Beck added a comment - SimpleDateFormat would be perfect, yes.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Alex Earl
          Path:
          src/main/java/hudson/plugins/emailext/plugins/content/AbstractChangesSinceContent.java
          src/main/java/hudson/plugins/emailext/plugins/content/ChangesSinceLastBuildContent.java
          src/test/java/hudson/plugins/emailext/plugins/content/ChangesSinceLastBuildContentTest.java
          src/test/java/hudson/plugins/emailext/plugins/content/ChangesSinceLastSuccessfulBuildContentTest.java
          src/test/java/hudson/plugins/emailext/plugins/content/ChangesSinceLastUnstableBuildContentTest.java
          http://jenkins-ci.org/commit/email-ext-plugin/6453a56cdcc82d2d7f085e8dba9c2b7032cb112a
          Log:
          Fix JENKINS-20151

          Added dateFormat parameter to change various CHANGES_SINCE... tokens. The format is the same as SimpleDateFormat uses.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Alex Earl Path: src/main/java/hudson/plugins/emailext/plugins/content/AbstractChangesSinceContent.java src/main/java/hudson/plugins/emailext/plugins/content/ChangesSinceLastBuildContent.java src/test/java/hudson/plugins/emailext/plugins/content/ChangesSinceLastBuildContentTest.java src/test/java/hudson/plugins/emailext/plugins/content/ChangesSinceLastSuccessfulBuildContentTest.java src/test/java/hudson/plugins/emailext/plugins/content/ChangesSinceLastUnstableBuildContentTest.java http://jenkins-ci.org/commit/email-ext-plugin/6453a56cdcc82d2d7f085e8dba9c2b7032cb112a Log: Fix JENKINS-20151 Added dateFormat parameter to change various CHANGES_SINCE... tokens. The format is the same as SimpleDateFormat uses.
          Hide
          slide_o_mix Alex Earl added a comment -

          Added dateFormat parameter to the CHANGES_SINCE tokens.

          Show
          slide_o_mix Alex Earl added a comment - Added dateFormat parameter to the CHANGES_SINCE tokens.
          Hide
          packcat John Pierce added a comment - - edited

          Can you show a complex example in use or point to an existing web example?

          such as:

          <DIV style="width:940px; max-width:940px; word-wrap: break-word; text-align: left;">

          <ul>${CHANGES_SINCE_LAST_SUCCESS, reverse=true, showPaths=true, format="%n\n<li>%c</li>\n", dateFormat="dd-MMM-yy", changesFormat="<font size='-1' color='#DA2F52'>►</font> %r<font color='black'> <font size='+1'><strong><<font color='#006600'>%a</font></strong></font> %m</font> - <font size='-1'><b>%d </b></font>"}</ul>

          </DIV>

          Thank you.

           

          Show
          packcat John Pierce added a comment - - edited Can you show a complex example in use or point to an existing web example? such as: <DIV style="width:940px; max-width:940px; word-wrap: break-word; text-align: left;"> <ul>${CHANGES_SINCE_LAST_SUCCESS, reverse=true, showPaths=true, format="%n\n<li>%c</li>\n", dateFormat="dd-MMM-yy", changesFormat="<font size='-1' color='#DA2F52'>►</font> %r<font color='black'> <font size='+1'> <strong><<font color='#006600'>%a</font></strong> </font> %m</font> - <font size='-1'><b> %d </b></font>"}</ul> </DIV> Thank you.  
          Hide
          slide_o_mix Alex Earl added a comment -

          Please don't hijack an issue with a question. You can ask questions on the jenkins-users mailing list.

          Show
          slide_o_mix Alex Earl added a comment - Please don't hijack an issue with a question. You can ask questions on the jenkins-users mailing list.

            People

            • Assignee:
              slide_o_mix Alex Earl
              Reporter:
              danielbeck Daniel Beck
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: