← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 97: -Made more regarding period name handling in Upward Reporting

 

------------------------------------------------------------
revno: 97
committer: Bharath <Bharath@hispindia>
branch nick: trunk
timestamp: Fri 2009-03-20 18:20:20 +0530
message:
  -Made more regarding period name handling in Upward Reporting
modified:
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/upward/action/GenerateUpwardReportAnalyserResultAction.java

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/upward/action/GenerateUpwardReportAnalyserResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/upward/action/GenerateUpwardReportAnalyserResultAction.java	2009-03-20 12:11:15 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/upward/action/GenerateUpwardReportAnalyserResultAction.java	2009-03-20 12:50:20 +0000
@@ -14,6 +14,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.UUID;
+import java.util.logging.SimpleFormatter;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -266,6 +267,13 @@
         return monthFormat;
     }
 
+    private SimpleDateFormat simpleMonthFormat;
+
+    public SimpleDateFormat getSimpleMonthFormat()
+    {
+        return simpleMonthFormat;
+    }
+
     private SimpleDateFormat yearFormat;
 
     public SimpleDateFormat getYearFormat()
@@ -273,6 +281,13 @@
         return yearFormat;
     }
 
+    private SimpleDateFormat simpleYearFormat;
+
+    public SimpleDateFormat getSimpleYearFormat()
+    {
+        return simpleYearFormat;
+    }
+
     private List<String> deCodeType;
 
     private List<String> serviceType;
@@ -373,7 +388,9 @@
         String deCodesXMLFileName = "";
         simpleDateFormat = new SimpleDateFormat( "MMM-yyyy" );
         monthFormat = new SimpleDateFormat( "MMMM" );
+        simpleMonthFormat= new SimpleDateFormat("MMM");
         yearFormat = new SimpleDateFormat( "yyyy" );
+        simpleYearFormat = new SimpleDateFormat("yy");
         deCodesXMLFileName = reportList + "DECodes.xml";
 
         String parentUnit = "";
@@ -575,6 +592,17 @@
                     tempStr = monthFormat.format( sDate );
 
                 }
+                else if ( deCodeString.equalsIgnoreCase( "MONTH-START" ) )
+                {
+                    tempStr = simpleMonthFormat.format( sDate );
+
+                }
+                else if ( deCodeString.equalsIgnoreCase( "MONTH-END" ) )
+                {
+                    tempStr = simpleMonthFormat.format( eDate );
+
+                }
+
                 else if ( deCodeString.equalsIgnoreCase( "PERIOD-WEEK" ) )
                 {
                     tempStr = String.valueOf( tempStartDate.get( Calendar.WEEK_OF_MONTH ) );
@@ -716,6 +744,24 @@
                     tempStr = yearFormat.format( sDate );
                 }
 
+                else if ( deCodeString.equalsIgnoreCase( "SIMPLE-YEAR" ) )
+                {
+                    if ( quarterPeriod != 0 )
+                    {
+
+                        Calendar tempQuarterYear = Calendar.getInstance();
+
+                        tempQuarterYear.setTime( sDate );
+
+                        tempQuarterYear.roll( Calendar.YEAR, -1 );
+
+                        sDate = tempQuarterYear.getTime();
+
+                    }
+
+                    tempStr = simpleYearFormat.format( sDate );
+                }
+
                 else if ( deCodeString.equalsIgnoreCase( "YEAR-END" ) )
                 {
 



--

https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.