获取指定日期字段的最小值，例如分钟的最小值是0

@param calendar {@link Calendar}
@param dateField {@link DateField}
@return 字段最小值
@since 4.5.7
@see Calendar#getActualMinimum(int)
779234
public static int getBeginValue(Calendar calendar, int dateField) {
		if(Calendar.DAY_OF_WEEK == dateField) {
			return calendar.getFirstDayOfWeek();
		}
		return calendar.getActualMinimum(dateField);
	}
669166
@Override
    public <V> V getMinimum(ChronoElement<V> element) {

        if (this.timestamp.contains(element)) {
            return this.timestamp.getMinimum(element);
        } else {
            return this.moment.getMinimum(element);
        }

    }
246765
public String format(Calendar calendar) {
    // As the relative period is calculated on epoch (timeInMillis), no TimeZone information is needed
    Calendar smscCalendar = Calendar.getInstance();
    return format(calendar, smscCalendar);
  }
511106
public static int getSecond(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        return c.get(Calendar.SECOND);
    }
630811
public Calendar getCalendar(final Calendar min, final Calendar max) {
		long millis = getLong(min.getTimeInMillis(), max.getTimeInMillis());
		return createCalendar(millis);
	}
759497
public int setCalendar(Calendar value, boolean bDisplayOption, int iMoveMode)
    {           // Set this field's value
        java.util.Date dateTemp = value.getTime();
        int errorCode = this.setData(dateTemp, bDisplayOption, iMoveMode);
        return errorCode;
    }
661490
public static Calendar modify(Calendar calendar, int dateField, ModifyType modifyType) {
		// 上下午特殊处理
		if (Calendar.AM_PM == dateField) {
			boolean isAM = DateUtil.isAM(calendar);
			switch (modifyType) {
			case TRUNCATE:
				calendar.set(Calendar.HOUR_OF_DAY, isAM ? 0 : 12);
				break;
			case CEILING:
				calendar.set(Calendar.HOUR_OF_DAY, isAM ? 11 : 23);
				break;
			case ROUND:
				int min = isAM ? 0 : 12;
				int max = isAM ? 11 : 23;
				int href = (max - min) / 2 + 1;
				int value = calendar.get(Calendar.HOUR_OF_DAY);
				calendar.set(Calendar.HOUR_OF_DAY, (value < href) ? min : max);
				break;
			}
		}

		// 当用户指定了无关字段时，降级字段
		if (ArrayUtil.contains(ignoreFields, dateField)) {
			return modify(calendar, dateField + 1, modifyType);
		}

		for (int i = Calendar.MILLISECOND; i > dateField; i--) {
			if (ArrayUtil.contains(ignoreFields, i) || Calendar.WEEK_OF_MONTH == i) {
				// 忽略无关字段（WEEK_OF_MONTH）始终不做修改
				continue;
			}

			if (Calendar.WEEK_OF_MONTH == dateField) {
				// 在星期模式下，月的处理忽略之
				if (Calendar.DAY_OF_MONTH == i) {
					continue;
				} else if (Calendar.DAY_OF_WEEK_IN_MONTH == i) {
					// 星期模式下，星期几统一用DAY_OF_WEEK处理
					i = Calendar.DAY_OF_WEEK;
				}
			} else if (Calendar.DAY_OF_WEEK_IN_MONTH == i) {
				// 非星期模式下，星期处理忽略之
				// 由于DAY_OF_WEEK忽略，自动降级到DAY_OF_WEEK_IN_MONTH
				continue;
			}

			modifyField(calendar, i, modifyType);
		}
		return calendar;
	}
1159853
public boolean activeOn (LocalDate date) {
        // first check for exceptions
        CalendarDate exception = calendar_dates.get(date);

        if (exception != null)
            return exception.exception_type == 1;

        else if (calendar == null)
            return false;

        else {
            int gtfsDate = date.getYear() * 10000 + date.getMonthValue() * 100 + date.getDayOfMonth();
            boolean withinValidityRange = calendar.end_date >= gtfsDate && calendar.start_date <= gtfsDate;

            if (!withinValidityRange) return false;

            switch (date.getDayOfWeek()) {
                case MONDAY:
                    return calendar.monday == 1;
                case TUESDAY:
                    return calendar.tuesday == 1;
                case WEDNESDAY:
                    return calendar.wednesday == 1;
                case THURSDAY:
                    return calendar.thursday == 1;
                case FRIDAY:
                    return calendar.friday == 1;
                case SATURDAY:
                    return calendar.saturday == 1;
                case SUNDAY:
                    return calendar.sunday == 1;
                default:
                    throw new IllegalArgumentException("unknown day of week constant!");
            }
        }
    }
1302071
public String getFMDate() {
        Calendar cal = Calendar.getInstance();
        cal.setTime(this);
        StringBuilder sb = new StringBuilder(15);
        int hour = cal.get(Calendar.HOUR_OF_DAY);
        
        if (hour == 0 && hasTime) {
            hour = 24;
            cal.add(Calendar.DAY_OF_MONTH, -1);
        }
        
        addFMPiece(sb, cal.get(Calendar.YEAR) - 1700, 0);
        addFMPiece(sb, cal.get(Calendar.MONTH) + 1, 2);
        addFMPiece(sb, cal.get(Calendar.DAY_OF_MONTH), 2);
        
        if (hasTime) {
            sb.append('.');
            addFMPiece(sb, hour, 2);
            addFMPiece(sb, cal.get(Calendar.MINUTE), 2);
            addFMPiece(sb, cal.get(Calendar.SECOND), 2);
            addFMPiece(sb, cal.get(Calendar.MILLISECOND), 2);
            
            for (int i = sb.length() - 1; i >= 0; i--) {
                char c = sb.charAt(i);
                
                if (c == '0') {
                    sb.deleteCharAt(i);
                } else if (c == '.') {
                    sb.deleteCharAt(i);
                    break;
                } else {
                    break;
                }
            }
        }
        
        return sb.toString();
    }
1324125
public static Date dateReservedMonth000(Calendar calendar) {
        calendar.set(Calendar.DAY_OF_MONTH, 1);

        return dateReservedDay000(calendar);
    }
1321794
private void getMonthlyAbsoluteDates(Calendar calendar, int frequency, List<Date> dates)
   {
      int currentDayNumber = calendar.get(Calendar.DAY_OF_MONTH);
      calendar.set(Calendar.DAY_OF_MONTH, 1);
      int requiredDayNumber = NumberHelper.getInt(m_dayNumber);
      if (requiredDayNumber < currentDayNumber)
      {
         calendar.add(Calendar.MONTH, 1);
      }

      while (moreDates(calendar, dates))
      {
         int useDayNumber = requiredDayNumber;
         int maxDayNumber = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
         if (useDayNumber > maxDayNumber)
         {
            useDayNumber = maxDayNumber;
         }
         calendar.set(Calendar.DAY_OF_MONTH, useDayNumber);
         dates.add(calendar.getTime());
         calendar.set(Calendar.DAY_OF_MONTH, 1);
         calendar.add(Calendar.MONTH, frequency);
      }
   }
626898
public CalendarModel getCalendarModel(FieldTable table)
    {
        if (m_model == null)
            if (table != null)
                m_model = new CalendarThinTableModel(table);
        return m_model;
    }
391551
function (calendar) {
            var time = calendar.getTime();
            calendar = /**@type {KISSY.Date.Gregorian}
         @ignore*/
            new GregorianCalendar(this.timezoneOffset, this.locale);
            calendar.setTime(time);
            var i, ret = [], pattern = this.pattern, len = pattern.length;
            for (i = 0; i < len; i++) {
                var comp = pattern[i];
                if (comp.text) {
                    ret.push(comp.text);
                } else if ('field' in comp) {
                    ret.push(formatField(comp.field, comp.count, this.locale, calendar));
                }
            }
            return ret.join('');
        }
288797
public static Integer getRemainingDayOfSeason(Date date) {

        if (date == null)
            return null;

        return getDayNumOfSeason(date) - getDayOfSeason(date);
    }
1185668
public void setDateFormatCalendar(Calendar calendar) {
        dateFormatter.setCalendar(calendar != null ? calendar : Calendar.getInstance());
        setDate(date, false);
    }
1142817
public Date getDate(final long min, final long max) {
		long millis = getLong(min, max);
		return DateUtils.truncate(new Date(millis), Calendar.DATE);
	}
958478
public static Calendar endOfQuarter(Calendar calendar) {
		calendar.set(Calendar.MONTH, calendar.get(DateField.MONTH.getValue()) / 3 * 3 + 2);
		calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
		return endOfDay(calendar);
	}