Author: dennisl
Date: Fri Jun  1 12:36:56 2007
New Revision: 543584

URL: http://svn.apache.org/viewvc?view=rev&rev=543584
Log:
[MCHANGELOG-60] Make the date and time formats configurable for the ChangeSet 
headings in the report

Modified:
    
maven/plugins/trunk/maven-changelog-plugin/src/main/java/org/apache/maven/plugin/changelog/ChangeLogReport.java

Modified: 
maven/plugins/trunk/maven-changelog-plugin/src/main/java/org/apache/maven/plugin/changelog/ChangeLogReport.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changelog-plugin/src/main/java/org/apache/maven/plugin/changelog/ChangeLogReport.java?view=diff&rev=543584&r1=543583&r2=543584
==============================================================================
--- 
maven/plugins/trunk/maven-changelog-plugin/src/main/java/org/apache/maven/plugin/changelog/ChangeLogReport.java
 (original)
+++ 
maven/plugins/trunk/maven-changelog-plugin/src/main/java/org/apache/maven/plugin/changelog/ChangeLogReport.java
 Fri Jun  1 12:36:56 2007
@@ -82,12 +82,14 @@
      */
     private static final String FILE_TOKEN = "%FILE%";
 
-    private static final String DEFAULT_DATE_PATTERN = "yyyy-MM-dd";
-
     /**
-     * Formatter used for dates.
+     * Used to specify the format to use for the dates in the headings of the
+     * report.
+     *
+     * @parameter expression="${changelog.headingDateFormat}" 
default-value="yyyy-MM-dd"
+     * @since 2.1
      */
-    private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat( 
DEFAULT_DATE_PATTERN );
+    private String headingDateFormat = "yyyy-MM-dd";
 
     /**
      * Used to specify whether to build the log using range, tag or date.
@@ -862,6 +864,9 @@
     protected void doChangeSetTitle( ChangeLogSet set, ResourceBundle bundle, 
Sink sink )
     {
         sink.sectionTitle2();
+
+        SimpleDateFormat headingDateFormater = new SimpleDateFormat( 
headingDateFormat );
+
         if ( set.getStartDate() == null )
         {
             sink.text( bundle.getString( "report.SetRangeUnknown" ) );
@@ -869,13 +874,13 @@
         else if ( set.getEndDate() == null )
         {
             sink.text( bundle.getString( "report.SetRangeSince" ) );
-            sink.text( " " + DATE_FORMAT.format( set.getStartDate() ) );
+            sink.text( " " + headingDateFormater.format( set.getStartDate() ) 
);
         }
         else
         {
             sink.text( bundle.getString( "report.SetRangeBetween" ) );
-            sink.text( " " + DATE_FORMAT.format( set.getStartDate() ) + " " + 
bundle.getString( "report.And" ) + " "
-                + DATE_FORMAT.format( set.getEndDate() ) );
+            sink.text( " " + headingDateFormater.format( set.getStartDate() ) 
+ " " + bundle.getString( "report.And" ) + " "
+                + headingDateFormater.format( set.getEndDate() ) );
         }
         sink.sectionTitle2_();
     }


Reply via email to