From 8500ddb19a1b9cc5bd947d6d5f0cac2c8c0e0817 Mon Sep 17 00:00:00 2001 From: Meno Hochschild Date: Fri, 28 Apr 2017 13:20:44 +0200 Subject: [PATCH] demo enhancement --- app/src/main/java/de/menodata/timedemoapp/MainActivity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/de/menodata/timedemoapp/MainActivity.java b/app/src/main/java/de/menodata/timedemoapp/MainActivity.java index 2b5c93f..79805eb 100644 --- a/app/src/main/java/de/menodata/timedemoapp/MainActivity.java +++ b/app/src/main/java/de/menodata/timedemoapp/MainActivity.java @@ -18,6 +18,7 @@ import net.time4j.Weekmodel; import net.time4j.calendar.EthiopianCalendar; import net.time4j.calendar.HijriCalendar; +import net.time4j.calendar.JapaneseCalendar; import net.time4j.calendar.PersianCalendar; import net.time4j.engine.StartOfDay; import net.time4j.format.CalendarText; @@ -67,6 +68,9 @@ private static String getTimeInfo(Context context) { ChronoFormatter pf = ChronoFormatter.setUp(PersianCalendar.class, Locale.ENGLISH) .addPattern("MMMM d, yyyy G", PatternType.NON_ISO_DATE).build(); + ChronoFormatter jf = + ChronoFormatter.setUp(JapaneseCalendar.class, Locale.ENGLISH) + .addPattern("MMMM d, G y", PatternType.NON_ISO_DATE).build(); ChronoFormatter hf = ChronoFormatter.setUp(HijriCalendar.class, Locale.ENGLISH) .addPattern("MM/dd/yyyy", PatternType.NON_ISO_DATE).build(); @@ -129,6 +133,7 @@ private static String getTimeInfo(Context context) { + "\n=> Hijri-toString=" + hijriDate + "\n=> Hijri-formatted=" + hf.format(hijriDate) + "\n=> Persian-today=" + pf.format(hijriDate.transform(PersianCalendar.class)) + + "\n=> Japanese-today=" + jf.format(hijriDate.transform(JapaneseCalendar.class)) + "\n=> Ethiopian moment" + "\n(parsed from 'Amete Mihret, 2008-03-09 03:45 PM +03:00')=" + ethio; }