public void testSkipDateTimeField() { DateTimeField field = new SkipDateTimeField (ISOChronology.getInstanceUTC(), ISOChronology.getInstanceUTC().year(), 1970); try { field.set(0, 1970); fail(); } catch (IllegalFieldValueException e) { assertEquals(DateTimeFieldType.year(), e.getDateTimeFieldType()); assertEquals(null, e.getDurationFieldType()); assertEquals("year", e.getFieldName()); assertEquals(new Integer(1970), e.getIllegalNumberValue()); assertEquals(null, e.getIllegalStringValue()); assertEquals("1970", e.getIllegalValueAsString()); assertEquals(null, e.getLowerBound()); assertEquals(null, e.getUpperBound()); } }
protected void assemble(Fields fields) { if (getBase() == null) { super.assemble(fields); // Julian chronology has no year zero. fields.year = new SkipDateTimeField(this, fields.year); fields.weekyear = new SkipDateTimeField(this, fields.weekyear); } }
protected void assemble(Fields fields) { if (getBase() == null) { super.assemble(fields); // Coptic, like Julian, has no year zero. fields.year = new SkipDateTimeField(this, fields.year); fields.weekyear = new SkipDateTimeField(this, fields.weekyear); fields.era = ERA_FIELD; fields.monthOfYear = new BasicMonthOfYearDateTimeField(this, 13); fields.months = fields.monthOfYear.getDurationField(); } }
protected void assemble(Fields fields) { if (getBase() == null) { super.assemble(fields); // Ethiopic, like Julian, has no year zero. fields.year = new SkipDateTimeField(this, fields.year); fields.weekyear = new SkipDateTimeField(this, fields.weekyear); fields.era = ERA_FIELD; fields.monthOfYear = new BasicMonthOfYearDateTimeField(this, 13); fields.months = fields.monthOfYear.getDurationField(); } }