org.joda.time.field.RemainderDateTimeField Java Examples

The following examples show how to use org.joda.time.field.RemainderDateTimeField. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ISOChronology.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
protected void assemble(Fields fields) {
    if (getBase().getZone() == DateTimeZone.UTC) {
        // Use zero based century and year of century.
        fields.centuryOfEra = new DividedDateTimeField(
            ISOYearOfEraDateTimeField.INSTANCE, DateTimeFieldType.centuryOfEra(), 100);
        fields.centuries = fields.centuryOfEra.getDurationField();
        
        fields.yearOfCentury = new RemainderDateTimeField(
            (DividedDateTimeField) fields.centuryOfEra, DateTimeFieldType.yearOfCentury());
        fields.weekyearOfCentury = new RemainderDateTimeField(
            (DividedDateTimeField) fields.centuryOfEra, fields.weekyears, DateTimeFieldType.weekyearOfCentury());
    }
}
 
Example #2
Source File: ISOChronology.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
protected void assemble(Fields fields) {
    if (getBase().getZone() == DateTimeZone.UTC) {
        // Use zero based century and year of century.
        fields.centuryOfEra = new DividedDateTimeField(
            ISOYearOfEraDateTimeField.INSTANCE, DateTimeFieldType.centuryOfEra(), 100);
        fields.yearOfCentury = new RemainderDateTimeField(
            (DividedDateTimeField) fields.centuryOfEra, DateTimeFieldType.yearOfCentury());
        fields.weekyearOfCentury = new RemainderDateTimeField(
            (DividedDateTimeField) fields.centuryOfEra, DateTimeFieldType.weekyearOfCentury());

        fields.centuries = fields.centuryOfEra.getDurationField();
    }
}