Search in sources :

Example 56 with Chronology

use of org.joda.time.Chronology in project joda-time by JodaOrg.

the class CopticChronology method readResolve.

/**
     * Serialization singleton.
     */
private Object readResolve() {
    Chronology base = getBase();
    int minDays = getMinimumDaysInFirstWeek();
    // handle rename of BaseGJChronology
    minDays = (minDays == 0 ? 4 : minDays);
    return base == null ? getInstance(DateTimeZone.UTC, minDays) : getInstance(base.getZone(), minDays);
}
Also used : Chronology(org.joda.time.Chronology)

Example 57 with Chronology

use of org.joda.time.Chronology in project joda-time by JodaOrg.

the class TestDateTimeFormatter method testParseLocalDate_weekyear_month_week_2010.

public void testParseLocalDate_weekyear_month_week_2010() {
    Chronology chrono = GJChronology.getInstanceUTC();
    DateTimeFormatter f = DateTimeFormat.forPattern("xxxx-MM-ww").withChronology(chrono);
    assertEquals(new LocalDate(2010, 1, 4, chrono), f.parseLocalDate("2010-01-01"));
}
Also used : Chronology(org.joda.time.Chronology) GJChronology(org.joda.time.chrono.GJChronology) ISOChronology(org.joda.time.chrono.ISOChronology) BuddhistChronology(org.joda.time.chrono.BuddhistChronology) LocalDate(org.joda.time.LocalDate)

Example 58 with Chronology

use of org.joda.time.Chronology in project joda-time by JodaOrg.

the class TestDateTimeFormatter method testParseLocalDate_year_month_week_2013.

public void testParseLocalDate_year_month_week_2013() {
    Chronology chrono = GJChronology.getInstanceUTC();
    DateTimeFormatter f = DateTimeFormat.forPattern("yyyy-MM-ww").withChronology(chrono);
    // 2013-01-01 would be better, but this is OK
    assertEquals(new LocalDate(2012, 12, 31, chrono), f.parseLocalDate("2013-01-01"));
}
Also used : Chronology(org.joda.time.Chronology) GJChronology(org.joda.time.chrono.GJChronology) ISOChronology(org.joda.time.chrono.ISOChronology) BuddhistChronology(org.joda.time.chrono.BuddhistChronology) LocalDate(org.joda.time.LocalDate)

Example 59 with Chronology

use of org.joda.time.Chronology in project joda-time by JodaOrg.

the class TestDateTimeFormatter method testParseLocalDate_year_month_week_2014.

public void testParseLocalDate_year_month_week_2014() {
    Chronology chrono = GJChronology.getInstanceUTC();
    DateTimeFormatter f = DateTimeFormat.forPattern("yyyy-MM-ww").withChronology(chrono);
    // 2014-01-01 would be better, but this is OK
    assertEquals(new LocalDate(2013, 12, 30, chrono), f.parseLocalDate("2014-01-01"));
}
Also used : Chronology(org.joda.time.Chronology) GJChronology(org.joda.time.chrono.GJChronology) ISOChronology(org.joda.time.chrono.ISOChronology) BuddhistChronology(org.joda.time.chrono.BuddhistChronology) LocalDate(org.joda.time.LocalDate)

Example 60 with Chronology

use of org.joda.time.Chronology in project joda-time by JodaOrg.

the class TestDateTimeFormatter method testParseLocalDate_year_month_week_2012.

public void testParseLocalDate_year_month_week_2012() {
    Chronology chrono = GJChronology.getInstanceUTC();
    DateTimeFormatter f = DateTimeFormat.forPattern("yyyy-MM-ww").withChronology(chrono);
    assertEquals(new LocalDate(2012, 1, 2, chrono), f.parseLocalDate("2012-01-01"));
}
Also used : Chronology(org.joda.time.Chronology) GJChronology(org.joda.time.chrono.GJChronology) ISOChronology(org.joda.time.chrono.ISOChronology) BuddhistChronology(org.joda.time.chrono.BuddhistChronology) LocalDate(org.joda.time.LocalDate)

Aggregations

Chronology (org.joda.time.Chronology)69 DateTime (org.joda.time.DateTime)32 ISOChronology (org.joda.time.chrono.ISOChronology)30 GJChronology (org.joda.time.chrono.GJChronology)18 BuddhistChronology (org.joda.time.chrono.BuddhistChronology)17 LocalDate (org.joda.time.LocalDate)14 DateTimeZone (org.joda.time.DateTimeZone)13 MutableDateTime (org.joda.time.MutableDateTime)7 LocalDateTime (org.joda.time.LocalDateTime)4 ReadableDateTime (org.joda.time.ReadableDateTime)4 JulianChronology (org.joda.time.chrono.JulianChronology)3 DateTimeFormatter (org.joda.time.format.DateTimeFormatter)3 Serializable (java.io.Serializable)2 Date (java.util.Date)2 Duration (org.joda.time.Duration)2 Period (org.joda.time.Period)2 ReadableDuration (org.joda.time.ReadableDuration)2 ReadableInstant (org.joda.time.ReadableInstant)2 ReadablePartial (org.joda.time.ReadablePartial)2 Calendar (java.util.Calendar)1