Example usage for org.joda.time DateTimeFieldType hourOfHalfday

List of usage examples for org.joda.time DateTimeFieldType hourOfHalfday

Introduction

In this page you can find the example usage for org.joda.time DateTimeFieldType hourOfHalfday.

Prototype

public static DateTimeFieldType hourOfHalfday() 

Source Link

Document

Get the hour of am/pm (0-11) field type.

Usage

From source file:com.evolveum.midpoint.web.component.DateInput.java

License:Apache License

public Date computeDateTime() {
    Date dateFieldInput = getDate();
    if (dateFieldInput == null) {
        return null;
    }// w  ww.  j  a va  2  s .  c  om

    Integer hoursInput = getHours();
    Integer minutesInput = getMinutes();
    AM_PM amOrPmInput = getAmOrPm();

    // Get year, month and day ignoring any timezone of the Date object
    Calendar cal = Calendar.getInstance();
    cal.setTime(dateFieldInput);
    int year = cal.get(Calendar.YEAR);
    int month = cal.get(Calendar.MONTH) + 1;
    int day = cal.get(Calendar.DAY_OF_MONTH);
    int hours = (hoursInput == null ? 0 : hoursInput % 24);
    int minutes = (minutesInput == null ? 0 : minutesInput);

    // Use the input to create a date object with proper timezone
    MutableDateTime date = new MutableDateTime(year, month, day, hours, minutes, 0, 0,
            DateTimeZone.forTimeZone(getClientTimeZone()));

    // Adjust for halfday if needed
    if (use12HourFormat()) {
        int halfday = (amOrPmInput == AM_PM.PM ? 1 : 0);
        date.set(DateTimeFieldType.halfdayOfDay(), halfday);
        date.set(DateTimeFieldType.hourOfHalfday(), hours % 12);
    }

    // The date will be in the server's timezone
    return newDateInstance(date.getMillis());
}

From source file:com.squarespace.template.plugins.PluginDateUtils.java

License:Apache License

private static void formatAggregate(DateTimeAggregate type, Locale locale, DateTime date, StringBuilder buf) {
    switch (type) {
    case FULL:/*  w  ww .j av a  2 s .c  o m*/
        buf.append(date.dayOfWeek().getAsShortText(locale));
        buf.append(' ');
        leftPad(date.dayOfMonth().get(), '0', 2, buf);
        buf.append(' ');
        buf.append(date.monthOfYear().getAsShortText(locale));
        buf.append(' ');
        buf.append(date.year().get());
        buf.append(' ');
        leftPad(date.get(DateTimeFieldType.clockhourOfHalfday()), '0', 2, buf);
        buf.append(':');
        leftPad(date.minuteOfHour().get(), '0', 2, buf);
        buf.append(':');
        leftPad(date.secondOfMinute().get(), '0', 2, buf);
        buf.append(' ');
        buf.append(date.get(DateTimeFieldType.halfdayOfDay()) == 0 ? "AM" : "PM");
        buf.append(' ');
        buf.append(date.getZone().getNameKey(date.getMillis()));
        break;

    case H240_M0:
        leftPad(date.get(DateTimeFieldType.clockhourOfDay()), '0', 2, buf);
        buf.append(':');
        leftPad(date.minuteOfHour().get(), '0', 2, buf);
        break;

    case HHMMSSP:
        leftPad(date.get(DateTimeFieldType.hourOfHalfday()), '0', 2, buf);
        buf.append(':');
        leftPad(date.getMinuteOfHour(), '0', 2, buf);
        buf.append(':');
        leftPad(date.getSecondOfMinute(), '0', 2, buf);
        buf.append(' ');
        buf.append(date.get(DateTimeFieldType.halfdayOfDay()) == 0 ? "AM" : "PM");
        break;

    case MMDDYY:
        leftPad(date.getMonthOfYear(), '0', 2, buf);
        buf.append('/');
        leftPad(date.dayOfMonth().get(), '0', 2, buf);
        buf.append('/');
        leftPad(date.yearOfCentury().get(), '0', 2, buf);
        break;

    case MMDDYYYY:
        leftPad(date.getMonthOfYear(), '0', 2, buf);
        buf.append('/');
        leftPad(date.dayOfMonth().get(), '0', 2, buf);
        buf.append('/');
        buf.append(date.getYear());
        break;

    case YYYYMMDD:
        buf.append(date.year().get());
        buf.append('-');
        leftPad(date.monthOfYear().get(), '0', 2, buf);
        buf.append('-');
        leftPad(date.dayOfMonth().get(), '0', 2, buf);
        break;

    default:
        break;
    }
}

From source file:ee.ut.soras.ajavtV2.mudel.ajavaljend.arvutus.TimeMLDateTimePoint.java

License:Open Source License

public void setField(Granulaarsus field, int value) {
    // ------ Time
    if (field == Granulaarsus.AM_PM) {
        try {//from w w  w  . j a  v  a 2s.  com
            this.underlyingTime = (this.underlyingTime).withField(DateTimeFieldType.halfdayOfDay(), value);
            updateTimeRepresentation(field, null, false, SET_TYPE_OPERATION);
        } catch (Exception e) {
        }
    }
    if (field == Granulaarsus.HOUR_OF_HALF_DAY) {
        try {
            if (value == 12) {
                value = 0;
            }
            this.underlyingTime = (this.underlyingTime).withField(DateTimeFieldType.hourOfHalfday(), value);
            // NB! Tunni seadistamisel nullime ka minutid, et ei tekiks nt ankurdamisel kummalisi vrtuseid
            this.underlyingTime = (this.underlyingTime).withField(DateTimeFieldType.minuteOfHour(), 0);
            updateTimeRepresentation(field, null, false, SET_TYPE_OPERATION);
        } catch (Exception e) {
        }
    }
    if (field == Granulaarsus.MINUTE) {
        try {
            this.underlyingTime = (this.underlyingTime).withField(DateTimeFieldType.minuteOfHour(), value);
            updateTimeRepresentation(field, null, false, SET_TYPE_OPERATION);
        } catch (Exception e) {
        }
    }
    // ------ Kuup2evad ja n2dalad
    if (field == Granulaarsus.DAY_OF_WEEK) {
        try {
            this.underlyingDate = (this.underlyingDate).withField(DateTimeFieldType.dayOfWeek(), value);
            dateModified = true;
            updateDateRepresentation(field, null, false, SET_TYPE_OPERATION);
        } catch (Exception e) {
        }
    }
    if (field == Granulaarsus.WEEK_OF_YEAR) {
        try {
            this.underlyingDate = (this.underlyingDate).withField(DateTimeFieldType.weekOfWeekyear(), value);
            dateModified = true;
            updateDateRepresentation(field, null, false, SET_TYPE_OPERATION);
        } catch (Exception e) {
        }
    }
    if (field == Granulaarsus.DAY_OF_MONTH) {
        try {
            this.underlyingDate = (this.underlyingDate).withField(DateTimeFieldType.dayOfMonth(), value);
            dateModified = true;
            updateDateRepresentation(field, null, false, SET_TYPE_OPERATION);
        } catch (Exception e) {
        }
    }
    if (field == Granulaarsus.MONTH) {
        try {
            this.underlyingDate = (this.underlyingDate).withField(DateTimeFieldType.monthOfYear(), value);
            dateModified = true;
            updateDateRepresentation(field, null, false, SET_TYPE_OPERATION);
        } catch (Exception e) {
        }
    }
    if (field == Granulaarsus.YEAR) {
        try {
            this.underlyingDate = (this.underlyingDate).withField(DateTimeFieldType.year(), value);
            dateModified = true;
            updateDateRepresentation(field, null, false, SET_TYPE_OPERATION);
        } catch (Exception e) {
        }
    }
    if (field == Granulaarsus.YEAR_OF_CENTURY) {
        try {
            this.underlyingDate = (this.underlyingDate).withField(DateTimeFieldType.yearOfCentury(), value);
            dateModified = true;
            // NB! Toimib nagu tavalise aastaarvu muutmine
            updateDateRepresentation(field, null, false, SET_TYPE_OPERATION);
        } catch (Exception e) {
        }
    }
    if (field == Granulaarsus.CENTURY_OF_ERA) {
        try {
            this.underlyingDate = (this.underlyingDate).withField(DateTimeFieldType.centuryOfEra(), value);
            dateModified = true;
            updateDateRepresentation(field, null, false, SET_TYPE_OPERATION);
        } catch (Exception e) {
        }
    }
}

From source file:ee.ut.soras.ajavtV2.mudel.ajavaljend.arvutus.TimeMLDateTimePoint.java

License:Open Source License

/**
 *   Updates time representation (hour, AM/PM, minute) in openedFields. If hour-field will be modified, 
 *   any existing values on minute-field will be deleted. If setLabel contains a part-of-day label and 
 *   granularity is TIME, AM/PM settings will be modified, according to current hourOfHalfday value in 
 *   underlyingTime.//w  ww .  ja  va2 s  . c om
 *   <br><br>
 *   When flag releaseMaskAtLowerGranularities is set, the input flag skipRemovingMaskFromChangedOne will
 *   be used to decide, whether mask will be removed from the field associated with changedGranularity.
 */
private void updateTimeRepresentation(Granulaarsus field, String setLabel, boolean skipOverwritingChangedOne,
        boolean setOrAddOperation) {
    // Memorize label and modification of the field 
    if (field == Granulaarsus.TIME && setLabel != null) {
        this.partOfDay = setLabel;
    }
    (this.modifiedGrans).put(field, "1");
    if (setLabel == null) {
        if (!skipOverwritingChangedOne) {
            //
            // HOUR_OF_HALF_DAY:
            //
            if (field == Granulaarsus.AM_PM) {
                (this.openedFields).put(VALUE_FIELD.HOUR_OR_POD,
                        normalizeByAddingZeroes(VALUE_FIELD.HOUR_OR_POD, (this.underlyingTime).getHourOfDay()));
                //(this.openedFields).remove(VALUE_FIELD.MINUTE);
            }
            if (field == Granulaarsus.HOUR_OF_HALF_DAY) {
                if (isModified(Granulaarsus.AM_PM)) {
                    (this.openedFields).put(VALUE_FIELD.HOUR_OR_POD, normalizeByAddingZeroes(
                            VALUE_FIELD.HOUR_OR_POD, (this.underlyingTime).getHourOfDay()));
                    (this.openedFields).remove(VALUE_FIELD.MINUTE);
                } else {
                    // Add to openedFields, so we can assume openedFields contains at least one value
                    (this.openedFields).put(VALUE_FIELD.HOUR_OR_POD, normalizeByAddingZeroes(
                            VALUE_FIELD.HOUR_OR_POD, (this.underlyingTime).getHourOfDay()));
                }
            }
            //
            //   MINUTE: if HOUR_OR_POD is unset or contains part-of-day, cover it with a mask
            //
            if (field == Granulaarsus.MINUTE) {
                (this.openedFields).put(VALUE_FIELD.MINUTE,
                        normalizeByAddingZeroes(VALUE_FIELD.MINUTE, (this.underlyingTime).getMinuteOfHour()));
            }
        }
    } else if (field == Granulaarsus.TIME) {
        if (!(this.openedFields).containsKey(VALUE_FIELD.HOUR_OR_POD)) {
            // If hour-part is still unset, fill it with the part of day ...
            (this.openedFields).put(VALUE_FIELD.HOUR_OR_POD, setLabel);
            (this.openedFields).remove(VALUE_FIELD.MINUTE);
        } else if (((this.openedFields).get(VALUE_FIELD.HOUR_OR_POD)).matches("[A-Z]+")) {
            // If hour-part is set, allow only overwriting the part-of-day
            (this.openedFields).put(VALUE_FIELD.HOUR_OR_POD, setLabel);
            (this.openedFields).remove(VALUE_FIELD.MINUTE);
        }
    }
    // Update hours according to part of time
    if ((this.openedFields).containsKey(VALUE_FIELD.HOUR_OR_POD) && isModified(Granulaarsus.HOUR_OF_HALF_DAY)
            && this.partOfDay != null && !isModified(Granulaarsus.AM_PM)) {
        int hourOfHalfDay = (this.underlyingTime).get(DateTimeFieldType.hourOfHalfday());
        //
        // Hour_of_Day:
        //    01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
        // Hour_of_HalfDay:
        //    01 02 03 04 05 06 07 08 09 10 11 00 01 02 03 04 05 06 07 08 09 10 11 00
        //                 AM                 |                 PM                |
        //
        if ((this.partOfDay).equals("NI")) {
            if (hourOfHalfDay >= 8 && hourOfHalfDay < 12) {
                this.setField(Granulaarsus.AM_PM, DateTimeConstants.PM);
            } else {
                this.setField(Granulaarsus.AM_PM, DateTimeConstants.AM);
            }
            return;
        }
        if ((this.partOfDay).equals("MO")) {
            if (hourOfHalfDay == 0) {
                this.setField(Granulaarsus.AM_PM, DateTimeConstants.PM);
            } else {
                this.setField(Granulaarsus.AM_PM, DateTimeConstants.AM);
            }
        }
        if ((this.partOfDay).equals("AF")) {
            this.setField(Granulaarsus.AM_PM, DateTimeConstants.PM);
        }
        if ((this.partOfDay).equals("DT")) {
            if (hourOfHalfDay == 0) {
                this.setField(Granulaarsus.AM_PM, DateTimeConstants.PM);
            } else if (9 <= hourOfHalfDay && hourOfHalfDay < 12) {
                this.setField(Granulaarsus.AM_PM, DateTimeConstants.AM);
            } else if (hourOfHalfDay <= 7) {
                this.setField(Granulaarsus.AM_PM, DateTimeConstants.PM);
            }
        }
        if ((this.partOfDay).equals("EV")) {
            if (hourOfHalfDay == 0) {
                this.setField(Granulaarsus.AM_PM, DateTimeConstants.AM);
            } else {
                this.setField(Granulaarsus.AM_PM, DateTimeConstants.PM);
            }
        }
    }
    // Manage masks on fields: open or close fields, if necessary
    manageMaskedFields(field, setLabel, skipOverwritingChangedOne, setOrAddOperation);
}

From source file:org.apache.wicket.extensions.yui.calendar.DateTimeField.java

License:Apache License

/**
 * Sets the converted input, which is an instance of {@link Date}, possibly null. It combines
 * the inputs of the nested date, hours, minutes and am/pm fields and constructs a date from it.
 * <p>// w ww  . j  a  v  a  2  s  . c o m
 * Note that overriding this method is a better option than overriding {@link #updateModel()}
 * like the first versions of this class did. The reason for that is that this method can be
 * used by form validators without having to depend on the actual model being updated, and this
 * method is called by the default implementation of {@link #updateModel()} anyway (so we don't
 * have to override that anymore).
 */
@Override
protected void convertInput() {
    try {
        // Get the converted input values
        Date dateFieldInput = dateField.getConvertedInput();
        Integer hoursInput = hoursField.getConvertedInput();
        Integer minutesInput = minutesField.getConvertedInput();
        AM_PM amOrPmInput = amOrPmChoice.getConvertedInput();

        if (dateFieldInput == null) {
            return;
        }

        // Get year, month and day ignoring any timezone of the Date object
        Calendar cal = Calendar.getInstance();
        cal.setTime(dateFieldInput);
        int year = cal.get(Calendar.YEAR);
        int month = cal.get(Calendar.MONTH) + 1;
        int day = cal.get(Calendar.DAY_OF_MONTH);
        int hours = (hoursInput == null ? 0 : hoursInput % 24);
        int minutes = (minutesInput == null ? 0 : minutesInput);

        // Use the input to create a date object with proper timezone
        MutableDateTime date = new MutableDateTime(year, month, day, hours, minutes, 0, 0,
                DateTimeZone.forTimeZone(getClientTimeZone()));

        // Adjust for halfday if needed
        if (use12HourFormat()) {
            int halfday = (amOrPmInput == AM_PM.PM ? 1 : 0);
            date.set(DateTimeFieldType.halfdayOfDay(), halfday);
            date.set(DateTimeFieldType.hourOfHalfday(), hours % 12);
        }

        // The date will be in the server's timezone
        setConvertedInput(new Date(date.getMillis()));
    } catch (RuntimeException e) {
        DateTimeField.this.error(e.getMessage());
        invalid();
    }
}

From source file:org.apache.wicket.extensions.yui.calendar.DateTimeField.java

License:Apache License

/**
 * @see org.apache.wicket.Component#onBeforeRender()
 *//*  ww  w  .j  av  a 2s. c  o  m*/
@Override
protected void onBeforeRender() {
    dateField.setRequired(isRequired());
    hoursField.setRequired(isRequired());
    minutesField.setRequired(isRequired());

    boolean use12HourFormat = use12HourFormat();
    amOrPmChoice.setVisible(use12HourFormat);

    Date modelObject = (Date) getDefaultModelObject();
    if (modelObject == null) {
        date = null;
        hours = null;
        minutes = null;
    } else {
        // convert date to the client's time zone if we have that info
        TimeZone zone = getClientTimeZone();
        if (zone != null) {
            modelObject = changeTimeZone(modelObject, zone);
        }

        MutableDateTime mDate = new MutableDateTime(modelObject);

        date = mDate.toDate();

        if (use12HourFormat) {
            int hourOfHalfDay = mDate.get(DateTimeFieldType.hourOfHalfday());
            hours = hourOfHalfDay == 0 ? 12 : hourOfHalfDay;
        } else {
            hours = mDate.get(DateTimeFieldType.hourOfDay());
        }

        amOrPm = (mDate.get(DateTimeFieldType.halfdayOfDay()) == 0) ? AM_PM.AM : AM_PM.PM;
        minutes = mDate.getMinuteOfHour();
    }

    super.onBeforeRender();
}

From source file:org.datavec.api.util.jackson.DateTimeFieldTypeDeserializer.java

License:Apache License

private static Map<String, DateTimeFieldType> getMap() {
    Map<String, DateTimeFieldType> ret = new HashMap<>();
    ret.put(DateTimeFieldType.centuryOfEra().getName(), DateTimeFieldType.centuryOfEra());
    ret.put(DateTimeFieldType.clockhourOfDay().getName(), DateTimeFieldType.clockhourOfDay());
    ret.put(DateTimeFieldType.clockhourOfHalfday().getName(), DateTimeFieldType.clockhourOfHalfday());
    ret.put(DateTimeFieldType.dayOfMonth().getName(), DateTimeFieldType.dayOfMonth());
    ret.put(DateTimeFieldType.dayOfWeek().getName(), DateTimeFieldType.dayOfWeek());
    ret.put(DateTimeFieldType.dayOfYear().getName(), DateTimeFieldType.dayOfYear());
    ret.put(DateTimeFieldType.era().getName(), DateTimeFieldType.era());
    ret.put(DateTimeFieldType.halfdayOfDay().getName(), DateTimeFieldType.halfdayOfDay());
    ret.put(DateTimeFieldType.hourOfDay().getName(), DateTimeFieldType.hourOfDay());
    ret.put(DateTimeFieldType.hourOfHalfday().getName(), DateTimeFieldType.hourOfHalfday());
    ret.put(DateTimeFieldType.millisOfDay().getName(), DateTimeFieldType.millisOfDay());
    ret.put(DateTimeFieldType.millisOfSecond().getName(), DateTimeFieldType.millisOfSecond());
    ret.put(DateTimeFieldType.minuteOfDay().getName(), DateTimeFieldType.minuteOfDay());
    ret.put(DateTimeFieldType.minuteOfHour().getName(), DateTimeFieldType.minuteOfHour());
    ret.put(DateTimeFieldType.secondOfDay().getName(), DateTimeFieldType.secondOfDay());
    ret.put(DateTimeFieldType.secondOfMinute().getName(), DateTimeFieldType.secondOfMinute());
    ret.put(DateTimeFieldType.weekOfWeekyear().getName(), DateTimeFieldType.weekOfWeekyear());
    ret.put(DateTimeFieldType.weekyear().getName(), DateTimeFieldType.weekyear());
    ret.put(DateTimeFieldType.weekyearOfCentury().getName(), DateTimeFieldType.weekyearOfCentury());
    ret.put(DateTimeFieldType.year().getName(), DateTimeFieldType.year());
    ret.put(DateTimeFieldType.yearOfCentury().getName(), DateTimeFieldType.yearOfCentury());
    ret.put(DateTimeFieldType.yearOfEra().getName(), DateTimeFieldType.yearOfEra());

    return ret;/*from w w  w . j  a  v  a 2s  .co m*/
}

From source file:org.wicketstuff.datetime.extensions.yui.calendar.DateTimeField.java

License:Apache License

/**
 * Sets the converted input, which is an instance of {@link Date}, possibly null. It combines
 * the inputs of the nested date, hours, minutes and am/pm fields and constructs a date from it.
 * <p>/*from w  ww . j a  v a  2s .  c  om*/
 * Note that overriding this method is a better option than overriding {@link #updateModel()}
 * like the first versions of this class did. The reason for that is that this method can be
 * used by form validators without having to depend on the actual model being updated, and this
 * method is called by the default implementation of {@link #updateModel()} anyway (so we don't
 * have to override that anymore).
 */
@Override
public void convertInput() {
    try {
        // Get the converted input values
        Date dateFieldInput = dateField.getConvertedInput();
        Integer hoursInput = hoursField.getConvertedInput();
        Integer minutesInput = minutesField.getConvertedInput();
        AM_PM amOrPmInput = amOrPmChoice.getConvertedInput();

        if (dateFieldInput == null) {
            return;
        }

        // Get year, month and day ignoring any timezone of the Date object
        Calendar cal = Calendar.getInstance();
        cal.setTime(dateFieldInput);
        int year = cal.get(Calendar.YEAR);
        int month = cal.get(Calendar.MONTH) + 1;
        int day = cal.get(Calendar.DAY_OF_MONTH);
        int hours = (hoursInput == null ? 0 : hoursInput % 24);
        int minutes = (minutesInput == null ? 0 : minutesInput);

        // Use the input to create a date object with proper timezone
        MutableDateTime date = new MutableDateTime(year, month, day, hours, minutes, 0, 0,
                DateTimeZone.forTimeZone(getClientTimeZone()));

        // Adjust for halfday if needed
        if (use12HourFormat()) {
            int halfday = (amOrPmInput == AM_PM.PM ? 1 : 0);
            date.set(DateTimeFieldType.halfdayOfDay(), halfday);
            date.set(DateTimeFieldType.hourOfHalfday(), hours % 12);
        }

        // The date will be in the server's timezone
        setConvertedInput(newDateInstance(date.getMillis()));
    } catch (RuntimeException e) {
        DateTimeField.this.error(e.getMessage());
        invalid();
    }
}

From source file:org.wicketstuff.datetime.extensions.yui.calendar.DateTimeField.java

License:Apache License

/**
 * @see org.apache.wicket.Component#onBeforeRender()
 *//*from   w  w w .j a va 2s  .  c  o  m*/
@Override
protected void onBeforeRender() {
    dateField.setRequired(isRequired());
    hoursField.setRequired(isRequired());
    minutesField.setRequired(isRequired());

    boolean use12HourFormat = use12HourFormat();
    amOrPmChoice.setVisible(use12HourFormat);

    Date modelObject = (Date) getDefaultModelObject();
    if (modelObject == null) {
        date = null;
        hours = null;
        minutes = null;
    } else {
        MutableDateTime mDate = new MutableDateTime(modelObject);
        // convert date to the client's time zone if we have that info
        TimeZone zone = getClientTimeZone();
        if (zone != null) {
            mDate.setZone(DateTimeZone.forTimeZone(zone));
        }

        date = mDate.toDateTime().toLocalDate().toDate();

        if (use12HourFormat) {
            int hourOfHalfDay = mDate.get(DateTimeFieldType.hourOfHalfday());
            hours = hourOfHalfDay == 0 ? 12 : hourOfHalfDay;
        } else {
            hours = mDate.get(DateTimeFieldType.hourOfDay());
        }

        amOrPm = (mDate.get(DateTimeFieldType.halfdayOfDay()) == 0) ? AM_PM.AM : AM_PM.PM;
        minutes = mDate.getMinuteOfHour();
    }

    super.onBeforeRender();
}

From source file:TVShowTimelineMaker.util.JodaTimeUtil.java

private void init() {
    // <editor-fold defaultstate="collapsed" desc="StandardDateTimeFieldTypeMap setup">
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.centuryOfEra().getName(),
            DateTimeFieldType.centuryOfEra());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.clockhourOfDay().getName(),
            DateTimeFieldType.clockhourOfDay());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.clockhourOfHalfday().getName(),
            DateTimeFieldType.clockhourOfHalfday());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.dayOfMonth().getName(),
            DateTimeFieldType.dayOfMonth());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.dayOfWeek().getName(),
            DateTimeFieldType.dayOfWeek());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.dayOfYear().getName(),
            DateTimeFieldType.dayOfYear());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.era().getName(), DateTimeFieldType.era());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.halfdayOfDay().getName(),
            DateTimeFieldType.halfdayOfDay());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.hourOfDay().getName(),
            DateTimeFieldType.hourOfDay());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.hourOfHalfday().getName(),
            DateTimeFieldType.hourOfHalfday());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.millisOfDay().getName(),
            DateTimeFieldType.millisOfDay());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.millisOfSecond().getName(),
            DateTimeFieldType.millisOfSecond());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.minuteOfDay().getName(),
            DateTimeFieldType.minuteOfDay());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.minuteOfHour().getName(),
            DateTimeFieldType.minuteOfHour());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.monthOfYear().getName(),
            DateTimeFieldType.monthOfYear());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.secondOfDay().getName(),
            DateTimeFieldType.secondOfDay());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.secondOfMinute().getName(),
            DateTimeFieldType.secondOfMinute());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.weekOfWeekyear().getName(),
            DateTimeFieldType.weekOfWeekyear());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.weekyear().getName(), DateTimeFieldType.weekyear());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.weekyearOfCentury().getName(),
            DateTimeFieldType.weekyearOfCentury());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.year().getName(), DateTimeFieldType.year());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.yearOfCentury().getName(),
            DateTimeFieldType.yearOfCentury());
    this.StandardDateTimeFieldTypeMap.put(DateTimeFieldType.yearOfEra().getName(),
            DateTimeFieldType.yearOfEra());
    // </editor-fold>
    // <editor-fold defaultstate="collapsed" desc="ChronologyMap setup">
    this.ChronologybidiMap.put("BuddhistChronology", org.joda.time.chrono.BuddhistChronology.class);
    this.ChronologybidiMap.put("CopticChronology", org.joda.time.chrono.CopticChronology.class);
    this.ChronologybidiMap.put("EthiopicChronology", org.joda.time.chrono.EthiopicChronology.class);
    this.ChronologybidiMap.put("GJChronology", org.joda.time.chrono.GJChronology.class);
    this.ChronologybidiMap.put("GregorianChronology", org.joda.time.chrono.GregorianChronology.class);
    this.ChronologybidiMap.put("ISOChronology", org.joda.time.chrono.ISOChronology.class);
    this.ChronologybidiMap.put("IslamicChronology", org.joda.time.chrono.IslamicChronology.class);
    this.ChronologybidiMap.put("JulianChronology", org.joda.time.chrono.JulianChronology.class);

    this.ChronologyInstanceMap.put("BuddhistChronology", org.joda.time.chrono.BuddhistChronology.getInstance());
    this.ChronologyInstanceMap.put("CopticChronology", org.joda.time.chrono.CopticChronology.getInstance());
    this.ChronologyInstanceMap.put("EthiopicChronology", org.joda.time.chrono.EthiopicChronology.getInstance());
    this.ChronologyInstanceMap.put("GJChronology", org.joda.time.chrono.GJChronology.getInstance());
    this.ChronologyInstanceMap.put("GregorianChronology",
            org.joda.time.chrono.GregorianChronology.getInstance());
    this.ChronologyInstanceMap.put("ISOChronology", org.joda.time.chrono.ISOChronology.getInstance());
    this.ChronologyInstanceMap.put("IslamicChronology", org.joda.time.chrono.IslamicChronology.getInstance());
    this.ChronologyInstanceMap.put("JulianChronology", org.joda.time.chrono.JulianChronology.getInstance());
    // </editor-fold>
}