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);
}
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"));
}
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"));
}
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"));
}
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"));
}
Aggregations