dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18163
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7547: Minor
------------------------------------------------------------
revno: 7547
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-07-09 21:56:12 +0200
message:
Minor
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/FinancialPeriodType.java
--
lp:dhis2
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
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/FinancialPeriodType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/FinancialPeriodType.java 2012-07-09 15:34:16 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/FinancialPeriodType.java 2012-07-09 19:56:12 +0000
@@ -72,7 +72,7 @@
{
boolean past = cal.get( Calendar.MONTH ) >= getBaseMonth();
- cal.set( Calendar.YEAR, past ? ( cal.get( Calendar.YEAR ) + 1 ) : cal.get( Calendar.YEAR ) );
+ cal.set( Calendar.YEAR, past ? cal.get( Calendar.YEAR ) : cal.get( Calendar.YEAR ) - 1 );
cal.set( Calendar.MONTH, getBaseMonth() );
cal.set( Calendar.DATE, 1 );
@@ -174,7 +174,8 @@
int year = Integer.parseInt( isoDate.substring( 0, 4 ) );
Calendar cal = createCalendarInstance();
cal.set( Calendar.YEAR, year );
- cal.set( Calendar.DAY_OF_YEAR, 1 );
+ cal.set( Calendar.MONTH, 11 );
+ cal.set( Calendar.DAY_OF_MONTH, 31 );
return createPeriod( cal );
}
}