/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * From v2.2, this method handles a daylight savings time gap, setting the * time to the first instant after the gap. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { try { return setCopy(getMinimumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) { // subtracting MILLIS_PER_DAY is not perfect, but will work in almost all situations long afterGap = getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY); return new DateTime(afterGap, getChronology()); } throw ex; } }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * From v2.2, this method handles a daylight savings time gap, setting the * time to the first instant after the gap. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { try { return setCopy(getMinimumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) { // subtracting MILLIS_PER_DAY is not perfect, but will work in almost all situations long afterGap = getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY); return new DateTime(afterGap, getChronology()); } throw ex; } }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * From v2.2, this method handles a daylight savings time gap, setting the * time to the first instant after the gap. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { try { return setCopy(getMinimumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) { // subtracting MILLIS_PER_DAY is not perfect, but will work in almost all situations long afterGap = getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY); return new DateTime(afterGap, getChronology()); } throw ex; } }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * From v2.2, this method handles a daylight svaings time gap, setting the * time to the first instant after the gap. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { try { return setCopy(getMinimumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) { // subtracting MILLIS_PER_DAY is not perfect, but will work in almost all situations long afterGap = getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY); return new DateTime(afterGap, getChronology()); } throw ex; } }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * From v2.2, this method handles a daylight svaings time gap, setting the * time to the first instant after the gap. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { try { return setCopy(getMinimumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) { // subtracting MILLIS_PER_DAY is not perfect, but will work in almost all situations long afterGap = getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY); return new DateTime(afterGap, getChronology()); } throw ex; } }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * From v2.2, this method handles a daylight svaings time gap, setting the * time to the first instant after the gap. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { try { return setCopy(getMinimumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) { // subtracting MILLIS_PER_DAY is not perfect, but will work in almost all situations long afterGap = getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY); return new DateTime(afterGap, getChronology()); } throw ex; } }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * From v2.2, this method handles a daylight svaings time gap, setting the * time to the first instant after the gap. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { try { return setCopy(getMinimumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) { // subtracting MILLIS_PER_DAY is not perfect, but will work in almost all situations long afterGap = getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY); return new DateTime(afterGap, getChronology()); } throw ex; } }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * From v2.2, this method handles a daylight svaings time gap, setting the * time to the first instant after the gap. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { try { return setCopy(getMinimumValue()); } catch (RuntimeException ex) { if (IllegalInstantException.isIllegalInstant(ex)) { // subtracting MILLIS_PER_DAY is not perfect, but will work in almost all situations long afterGap = getChronology().getZone().nextTransition(getMillis() - DateTimeConstants.MILLIS_PER_DAY); return new DateTime(afterGap, getChronology()); } throw ex; } }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { return setCopy(getMinimumValue()); }
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { return setCopy(getMinimumValue()); }
/** * Return the minimum value of a field, closest to the reference time */ public static int minimumValue(DateTimeFieldType type, ReadableDateTime reference){ return reference.toDateTime().property(type).getMinimumValue(); } /**
/** * Return the minimum value of a field, closest to the reference time */ public static int minimumValue(DateTimeFieldType type, ReadableDateTime reference){ return reference.toDateTime().property(type).getMinimumValue(); } /**
/** * Returns a new DateTime with this field set to the minimum value * for this field. * <p> * Where possible, the offset from UTC will be retained, thus applications * may need to call {@link DateTime#withEarlierOffsetAtOverlap()} on the result * to force the earlier time during a DST overlap if desired. * <p> * The DateTime attached to this property is unchanged by this call. * * @return a copy of the DateTime with this field set to its minimum * @since 1.2 */ public DateTime withMinimumValue() { return setCopy(getMinimumValue()); }
/** * Return the minimum value of a field, closest to the reference time */ public static int minimumValue(DateTimeFieldType type, ReadableDateTime reference){ return reference.toDateTime().property(type).getMinimumValue(); } /**