Skip to content

Commit

Permalink
demo enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
MenoData committed Apr 28, 2017
1 parent 9648516 commit 8500ddb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/src/main/java/de/menodata/timedemoapp/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -67,6 +68,9 @@ private static String getTimeInfo(Context context) {
ChronoFormatter<PersianCalendar> pf =
ChronoFormatter.setUp(PersianCalendar.class, Locale.ENGLISH)
.addPattern("MMMM d, yyyy G", PatternType.NON_ISO_DATE).build();
ChronoFormatter<JapaneseCalendar> jf =
ChronoFormatter.setUp(JapaneseCalendar.class, Locale.ENGLISH)
.addPattern("MMMM d, G y", PatternType.NON_ISO_DATE).build();
ChronoFormatter<HijriCalendar> hf =
ChronoFormatter.setUp(HijriCalendar.class, Locale.ENGLISH)
.addPattern("MM/dd/yyyy", PatternType.NON_ISO_DATE).build();
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 8500ddb

Please sign in to comment.