Package org.goda.time.field

Examples of org.goda.time.field.OffsetDateTimeField


    protected void assemble(Fields fields) {
        if (getParam() == null) {
            // julian chrono removed zero, but we need to put it back
            DateTimeField field = fields.year;
            fields.year = new OffsetDateTimeField(
                    new SkipUndoDateTimeField(this, field), BUDDHIST_OFFSET);
           
            // one era, so yearOfEra is the same
            field = fields.yearOfEra;
            fields.yearOfEra = new DelegatedDateTimeField(
                fields.year, DateTimeFieldType.yearOfEra());
           
            // julian chrono removed zero, but we need to put it back
            field = fields.weekyear;
            fields.weekyear = new OffsetDateTimeField(
                    new SkipUndoDateTimeField(this, field), BUDDHIST_OFFSET);
           
            field = new OffsetDateTimeField(fields.yearOfEra, 99);
            fields.centuryOfEra = new DividedDateTimeField(
                field, DateTimeFieldType.centuryOfEra(), 100);
           
            field = new RemainderDateTimeField(
                (DividedDateTimeField) fields.centuryOfEra);
            fields.yearOfCentury = new OffsetDateTimeField(
                field, DateTimeFieldType.yearOfCentury(), 1);
           
            field = new RemainderDateTimeField(
                fields.weekyear, DateTimeFieldType.weekyearOfCentury(), 100);
            fields.weekyearOfCentury = new OffsetDateTimeField(
                field, DateTimeFieldType.weekyearOfCentury(), 1);
           
            fields.era = ERA_FIELD;
        }
    }
View Full Code Here


    protected void assemble(Fields fields) {
        if (getParam() == null) {
            // julian chrono removed zero, but we need to put it back
            DateTimeField field = fields.year;
            fields.year = new OffsetDateTimeField(
                    new SkipUndoDateTimeField(this, field), BUDDHIST_OFFSET);
           
            // one era, so yearOfEra is the same
            field = fields.yearOfEra;
            fields.yearOfEra = new DelegatedDateTimeField(
                fields.year, DateTimeFieldType.yearOfEra());
           
            // julian chrono removed zero, but we need to put it back
            field = fields.weekyear;
            fields.weekyear = new OffsetDateTimeField(
                    new SkipUndoDateTimeField(this, field), BUDDHIST_OFFSET);
           
            field = new OffsetDateTimeField(fields.yearOfEra, 99);
            fields.centuryOfEra = new DividedDateTimeField(
                field, DateTimeFieldType.centuryOfEra(), 100);
           
            field = new RemainderDateTimeField(
                (DividedDateTimeField) fields.centuryOfEra);
            fields.yearOfCentury = new OffsetDateTimeField(
                field, DateTimeFieldType.yearOfCentury(), 1);
           
            field = new RemainderDateTimeField(
                fields.weekyear, DateTimeFieldType.weekyearOfCentury(), 100);
            fields.weekyearOfCentury = new OffsetDateTimeField(
                field, DateTimeFieldType.weekyearOfCentury(), 1);
           
            fields.era = ERA_FIELD;
        }
    }
View Full Code Here

        fields.year = new BasicYearDateTimeField(this);
        fields.yearOfEra = new GJYearOfEraDateTimeField(fields.year, this);

        // Define one-based centuryOfEra and yearOfCentury.
        DateTimeField field = new OffsetDateTimeField(
            fields.yearOfEra, 99);
        fields.centuryOfEra = new DividedDateTimeField(
            field, DateTimeFieldType.centuryOfEra(), 100);
       
        field = new RemainderDateTimeField(
            (DividedDateTimeField) fields.centuryOfEra);
        fields.yearOfCentury = new OffsetDateTimeField(
            field, DateTimeFieldType.yearOfCentury(), 1);

        fields.era = new GJEraDateTimeField(this);
        fields.dayOfWeek = new GJDayOfWeekDateTimeField(this, fields.days);
        fields.dayOfMonth = new BasicDayOfMonthDateTimeField(this, fields.days);
        fields.dayOfYear = new BasicDayOfYearDateTimeField(this, fields.days);
        fields.monthOfYear = new GJMonthOfYearDateTimeField(this);
        fields.weekyear = new BasicWeekyearDateTimeField(this);
        fields.weekOfWeekyear = new BasicWeekOfWeekyearDateTimeField(this, fields.weeks);
       
        field = new RemainderDateTimeField(
            fields.weekyear, DateTimeFieldType.weekyearOfCentury(), 100);
        fields.weekyearOfCentury = new OffsetDateTimeField(
            field, DateTimeFieldType.weekyearOfCentury(), 1);
       
        // The remaining (imprecise) durations are available from the newly
        // created datetime fields.
View Full Code Here

TOP

Related Classes of org.goda.time.field.OffsetDateTimeField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.