List of usage examples for org.joda.time.chrono EthiopicChronology getInstance
public static EthiopicChronology getInstance()
From source file:org.odk.collect.android.fragments.dialogs.EthiopianDatePickerDialog.java
License:Apache License
private void setUpDatePicker() { LocalDateTime ethiopianDate = DateTimeUtils.skipDaylightSavingGapIfExists(getDate()).toDateTime() .withChronology(EthiopicChronology.getInstance()).toLocalDateTime(); setUpDayPicker(ethiopianDate.getDayOfMonth(), ethiopianDate.dayOfMonth().getMaximumValue()); setUpMonthPicker(ethiopianDate.getMonthOfYear(), monthsArray); setUpYearPicker(ethiopianDate.getYear(), MIN_SUPPORTED_YEAR, MAX_SUPPORTED_YEAR); }
From source file:org.odk.collect.android.fragments.dialogs.EthiopianDatePickerDialog.java
License:Apache License
private LocalDateTime getCurrentEthiopianDate() { int ethiopianDay = getDay(); int ethiopianMonth = Arrays.asList(monthsArray).indexOf(getMonth()); int ethiopianYear = getYear(); LocalDateTime ethiopianDate = new LocalDateTime(ethiopianYear, ethiopianMonth + 1, 1, 0, 0, 0, 0, EthiopicChronology.getInstance()); if (ethiopianDay > ethiopianDate.dayOfMonth().getMaximumValue()) { ethiopianDay = ethiopianDate.dayOfMonth().getMaximumValue(); }/*w ww . j a v a2s . c o m*/ return new LocalDateTime(ethiopianYear, ethiopianMonth + 1, ethiopianDay, 0, 0, 0, 0, EthiopicChronology.getInstance()); }