/** * Restricted constructor */ BasicWeekyearDateTimeField(BasicChronology chronology) { super(DateTimeFieldType.weekyear(), chronology.getAverageMillisPerYear()); iChronology = chronology; }
/** * Instructs the printer to emit a numeric weekyear field. * * @param minDigits minimum number of digits to <i>print</i> * @param maxDigits maximum number of digits to <i>parse</i>, or the estimated * maximum number of digits to print * @return this DateTimeFormatterBuilder, for chaining */ public DateTimeFormatterBuilder appendWeekyear(int minDigits, int maxDigits) { return appendSignedDecimal(DateTimeFieldType.weekyear(), minDigits, maxDigits); }
/** * Restricted constructor */ BasicWeekyearDateTimeField(BasicChronology chronology) { super(DateTimeFieldType.weekyear(), chronology.getAverageMillisPerYear()); iChronology = chronology; }
/** * Instructs the printer to emit a numeric weekyear field. * * @param minDigits minimum number of digits to <i>print</i> * @param maxDigits maximum number of digits to <i>parse</i>, or the estimated * maximum number of digits to print * @return this DateTimeFormatterBuilder, for chaining */ public DateTimeFormatterBuilder appendWeekyear(int minDigits, int maxDigits) { return appendSignedDecimal(DateTimeFieldType.weekyear(), minDigits, maxDigits); }
/** * Get the year of a week based year field for this chronology. * * @return DateTimeField or UnsupportedDateTimeField if unsupported */ public DateTimeField weekyear() { return UnsupportedDateTimeField.getInstance(DateTimeFieldType.weekyear(), weekyears()); }
protected void appendWeekyear(int minDigits, int maxDigits) { builder.appendWeekyear(minDigits, maxDigits); appendNumericField(DateTimeFieldType.weekyear(), minDigits, maxDigits); } protected void appendTwoDigitWeekyear(int pivot, boolean lenient) {
/** * Get the year of a week based year field for this chronology. * * @return DateTimeField or UnsupportedDateTimeField if unsupported */ public DateTimeField weekyear() { return UnsupportedDateTimeField.getInstance(DateTimeFieldType.weekyear(), weekyears()); }
/** * Instructs the printer to emit a numeric weekyear field which always prints * two digits. A pivot year is used during parsing to determine the range * of supported years as <code>(pivot - 50) .. (pivot + 49)</code>. If * parse is instructed to be lenient and the digit count is not two, it is * treated as an absolute weekyear. With lenient parsing, specifying a positive * or negative sign before the weekyear also makes it absolute. * * @param pivot pivot weekyear to use when parsing * @param lenientParse when true, if digit count is not two, it is treated * as an absolute weekyear * @return this DateTimeFormatterBuilder, for chaining * @since 1.1 */ public DateTimeFormatterBuilder appendTwoDigitWeekyear(int pivot, boolean lenientParse) { return append0(new TwoDigitYear(DateTimeFieldType.weekyear(), pivot, lenientParse)); }
/** * Instructs the printer to emit a numeric weekyear field which always prints * two digits. A pivot year is used during parsing to determine the range * of supported years as <code>(pivot - 50) .. (pivot + 49)</code>. If * parse is instructed to be lenient and the digit count is not two, it is * treated as an absolute weekyear. With lenient parsing, specifying a positive * or negative sign before the weekyear also makes it absolute. * * @param pivot pivot weekyear to use when parsing * @param lenientParse when true, if digit count is not two, it is treated * as an absolute weekyear * @return this DateTimeFormatterBuilder, for chaining * @since 1.1 */ public DateTimeFormatterBuilder appendTwoDigitWeekyear(int pivot, boolean lenientParse) { return append0(new TwoDigitYear(DateTimeFieldType.weekyear(), pivot, lenientParse)); }
public int getMaximumValue(ReadablePartial partial, int[] values) { int size = partial.size(); for (int i = 0; i < size; i++) { if (partial.getFieldType(i) == DateTimeFieldType.weekyear()) { int weekyear = values[i]; return iChronology.getWeeksInYear(weekyear); } } return 53; }
public int getMaximumValue(ReadablePartial partial, int[] values) { int size = partial.size(); for (int i = 0; i < size; i++) { if (partial.getFieldType(i) == DateTimeFieldType.weekyear()) { int weekyear = values[i]; return iChronology.getWeeksInYear(weekyear); } } return 53; }
bld.append(Constants.ye); reducedPrec = true; } else if (workingFields.remove(DateTimeFieldType.weekyear())) { bld.append(Constants.we); reducedPrec = true;
bld.append(Constants.ye); reducedPrec = true; } else if (workingFields.remove(DateTimeFieldType.weekyear())) { bld.append(Constants.we); reducedPrec = true;
public static Partial withWeekYear(Partial p) { Partial res = new Partial(); for (int i = 0; i < p.size(); i++) { DateTimeFieldType fieldType = p.getFieldType(i); if (fieldType == DateTimeFieldType.year()) { res = res.with(DateTimeFieldType.weekyear(), p.getValue(i)); } else { res = res.with(fieldType, p.getValue(i)); } } return res; }
if (fields.remove(DateTimeFieldType.weekyear())) { bld.append(Constants.we); if (fields.remove(DateTimeFieldType.weekOfWeekyear())) {
if (fields.remove(DateTimeFieldType.weekyear())) { bld.append(Constants.we); if (fields.remove(DateTimeFieldType.weekOfWeekyear())) {
public int getMaximumValue(ReadablePartial partial, int[] values) { int size = partial.size(); for (int i = 0; i < size; i++) { if (partial.getFieldType(i) == DateTimeFieldType.weekyear()) { int weekyear = values[i]; return iChronology.getWeeksInYear(weekyear); } } return 53; }
} else if (JodaTimeUtils.hasField(base, DateTimeFieldType.weekyear())) { builder.appendWeekyear(4, 4); } else {