[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3346: Make I18nFormat::formatPeriod() use getIsoDate() for weekly periods

revision-diff.txt (619 Bytes)

Hi Bob,

Thanks for this. I guess this is better than it was before, but I
still think it is only a partial fix. The format patters...

format.Weekly.startDate = 'Week' w' '
format.Weekly.endDate = yyyy

in i18n_*.properties are going to be effectively ignored of course,
which means people will not be able to change the format.

It would seem that the actual fix would be to implement the ISO Week
as yyyyww in the resource bundle? I guess this is OK, and better than
before, but it seems to defeat the purpose of i18n.

While we are hardcoding this stuff, can we do so for quarters as well,
so that Jan1-March31 2011 is displayed as Q12011?

Regards,
Jason

ยทยทยท

On Mon, Apr 11, 2011 at 3:57 PM, <noreply@launchpad.net> wrote:

------------------------------------------------------------
revno: 3346
committer: Bob Joliffe <bobjolliffe@gmail.com>
branch nick: dhis2
timestamp: Mon 2011-04-11 14:54:09 +0100
message:
Make I18nFormat::formatPeriod() use getIsoDate() for weekly periods
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/I18nFormat.java

--
lp:dhis2
trunk : Code : DHIS

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to OpenID transaction in progress

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/I18nFormat.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/I18nFormat.java 2011-03-20 13:57:42 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/I18nFormat.java 2011-04-11 13:54:09 +0000
@@ -175,6 +175,10 @@

    String typeName = period\.getPeriodType\(\)\.getName\(\);

+ if (typeName.equals( "Weekly")) {
+ return period.getIsoDate();
+ }
+
String keyStartDate = "format." + typeName + ".startDate";
String keyEndDate = "format." + typeName + ".endDate";

_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293