Example usage for org.joda.time.chrono EthiopicChronology getInstance

List of usage examples for org.joda.time.chrono EthiopicChronology getInstance

Introduction

In this page you can find the example usage for org.joda.time.chrono EthiopicChronology getInstance.

Prototype

public static EthiopicChronology getInstance() 

Source Link

Document

Gets an instance of the EthiopicChronology in the default time zone.

Usage

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());
}