use of org.joda.time.MutableDateTime in project joda-time by JodaOrg.
the class TestDateTimeFormatter method testParseInto_monthDay_feb29_newYork_endOfYear.
public void testParseInto_monthDay_feb29_newYork_endOfYear() {
DateTimeFormatter f = DateTimeFormat.forPattern("M d").withLocale(Locale.UK);
MutableDateTime result = new MutableDateTime(2004, 12, 31, 23, 59, 59, 999, NEWYORK);
assertEquals(4, f.parseInto(result, "2 29", 0));
assertEquals(new MutableDateTime(2004, 2, 29, 23, 59, 59, 999, NEWYORK), result);
}
use of org.joda.time.MutableDateTime in project joda-time by JodaOrg.
the class TestDateTimeFormatter method testParseInto_monthDay_withDefaultYear_feb29_newYork_endOfYear.
public void testParseInto_monthDay_withDefaultYear_feb29_newYork_endOfYear() {
DateTimeFormatter f = DateTimeFormat.forPattern("M d").withDefaultYear(2012);
MutableDateTime result = new MutableDateTime(2004, 12, 9, 12, 20, 30, 0, NEWYORK);
assertEquals(4, f.parseInto(result, "2 29", 0));
assertEquals(new MutableDateTime(2004, 2, 29, 12, 20, 30, 0, NEWYORK), result);
}
use of org.joda.time.MutableDateTime in project joda-time by JodaOrg.
the class TestDateTimeFormatter method testParseInto_monthDay_feb29.
public void testParseInto_monthDay_feb29() {
DateTimeFormatter f = DateTimeFormat.forPattern("M d").withLocale(Locale.UK);
MutableDateTime result = new MutableDateTime(2004, 1, 9, 12, 20, 30, 0, LONDON);
assertEquals(4, f.parseInto(result, "2 29", 0));
assertEquals(new MutableDateTime(2004, 2, 29, 12, 20, 30, 0, LONDON), result);
}
use of org.joda.time.MutableDateTime in project joda-time by JodaOrg.
the class TestDateTimeFormatter method testParseInto_monthDay_withDefaultYear_feb29_newYork.
public void testParseInto_monthDay_withDefaultYear_feb29_newYork() {
DateTimeFormatter f = DateTimeFormat.forPattern("M d").withDefaultYear(2012);
MutableDateTime result = new MutableDateTime(2004, 1, 9, 12, 20, 30, 0, NEWYORK);
assertEquals(4, f.parseInto(result, "2 29", 0));
assertEquals(new MutableDateTime(2004, 2, 29, 12, 20, 30, 0, NEWYORK), result);
}
use of org.joda.time.MutableDateTime in project joda-time by JodaOrg.
the class TestDateTimeFormatter method testParseInto_monthOnly.
public void testParseInto_monthOnly() {
DateTimeFormatter f = DateTimeFormat.forPattern("M").withLocale(Locale.UK);
MutableDateTime result = new MutableDateTime(2004, 1, 9, 12, 20, 30, 0, LONDON);
assertEquals(1, f.parseInto(result, "5", 0));
assertEquals(new MutableDateTime(2004, 5, 9, 12, 20, 30, 0, LONDON), result);
}
Aggregations