Transform a {@link Calendar} style constant into an ICU context value.
434978
private static int toContext(int style) {
        switch (style) {
            case Calendar.SHORT_FORMAT:
            case Calendar.NARROW_FORMAT:
            case Calendar.LONG_FORMAT:
                return DateFormatSymbols.FORMAT;
            case Calendar.SHORT_STANDALONE:
            case Calendar.NARROW_STANDALONE:
            case Calendar.LONG_STANDALONE:
                return DateFormatSymbols.STANDALONE;
            default:
                throw new IllegalArgumentException("Invalid style: " + style);
        }
    }
187826
public void setCalendar(Calendar calendar) {
		if (calendar == null) {
			dateEditor.setDate(null);
		} else {
			dateEditor.setDate(calendar.getTime());
		}
	}
638738
private static void forSpecialValue(Map<String, Object> conditionMap) {
        conditionMap.keySet().forEach(key -> {
            Object value = conditionMap.get(key);
            if (value instanceof String) {
                conditionMap.put(key, "'".concat(value.toString()).concat("'"));
            }
            if (value instanceof Date) {
                String dateString = DateConverterFactory.getDateConverter().toStandardString((Date) value);
                conditionMap.put(key, "'".concat(dateString).concat("'"));
            }
            if (value instanceof Calendar) {
                String dateString = DateConverterFactory.getDateConverter().toStandardString((Calendar) value);
                conditionMap.put(key, "'".concat(dateString).concat("'"));
            }
            if (value instanceof Number) {
                conditionMap.put(key, value.toString());
            }
        });
    }
564431
static String getIntervalPattern(ChronoParser<?> parser) {

        AttributeQuery attrs = parser.getAttributes();

        if (attrs.contains(Attributes.LANGUAGE)) {
            Locale locale = attrs.get(Attributes.LANGUAGE);
            return CalendarText.patternForInterval(locale);
        }

        return "{0}/{1}";

    }
1260989
public Expression<Calendar> neq(Calendar value) {
		String valueString = "'" + getCalendarAsString(value) + "'";
		return new Expression<Calendar>(this, Operation.neq, valueString);
	}
927321
@Override
    public Object getValue() {
        Date d = Calendar.getInstance().getTime();
        try {
            d = DEFAULT_DATE_FORMAT.parse(((JTextField) editor).getText());
        } catch (ParseException ex) {
            Logger.getLogger(CalendarStringPropertyEditor.class.getName()).log(Level.SEVERE, null, ex);
        }
        Calendar c = Calendar.getInstance();
        c.setTime(d);
        return c;
    }
133804
public static ZonedDateTime toNullableDateTime(Object value) {
		if (value == null)
			return null;
		if (value instanceof ZonedDateTime)
			return (ZonedDateTime) value;

		if (value instanceof Calendar) {
			Calendar calendar = (Calendar) value;
			return ZonedDateTime.ofInstant(calendar.toInstant(), calendar.getTimeZone().toZoneId());
		}
		if (value instanceof Date)
			return ZonedDateTime.ofInstant(((Date) value).toInstant(), ZoneId.systemDefault());

		if (value instanceof LocalDate)
			return ZonedDateTime.of((LocalDate) value, LocalTime.of(0, 0), ZoneId.systemDefault());
		if (value instanceof LocalDateTime)
			return ZonedDateTime.of((LocalDateTime) value, ZoneId.systemDefault());

		if (value instanceof Integer)
			return millisToDateTime((int) value);
		if (value instanceof Short)
			return millisToDateTime((short) value);
		if (value instanceof Long)
			return millisToDateTime((long) value);
		if (value instanceof Float)
			return millisToDateTime((long) ((float) value));
		if (value instanceof Double)
			return millisToDateTime((long) ((double) value));
		if (value instanceof Duration)
			return millisToDateTime(((Duration) value).toMillis());

		if (value instanceof String) {
			try {
				return ZonedDateTime.parse((String) value, DateTimeFormatter.ISO_OFFSET_DATE_TIME);
			} catch (DateTimeParseException ex) {
			}

			try {
				return ZonedDateTime.of(LocalDateTime.parse((String) value, simpleDateTimeFormatter),
						ZoneId.systemDefault());
			} catch (DateTimeParseException ex) {
			}

			try {
				return ZonedDateTime.of(LocalDate.parse((String) value, simpleDateFormatter), LocalTime.of(0, 0),
						ZoneId.systemDefault());
			} catch (DateTimeParseException ex) {
			}
		}

		return null;
	}
834539
function() {

        var defStyle = Calendar.STYLES;

        this.Style = {
            /**
            * @property Style.CSS_ROW_HEADER
            */
            CSS_ROW_HEADER: defStyle.CSS_ROW_HEADER,
            /**
            * @property Style.CSS_ROW_FOOTER
            */
            CSS_ROW_FOOTER: defStyle.CSS_ROW_FOOTER,
            /**
            * @property Style.CSS_CELL
            */
            CSS_CELL : defStyle.CSS_CELL,
            /**
            * @property Style.CSS_CELL_SELECTOR
            */
            CSS_CELL_SELECTOR : defStyle.CSS_CELL_SELECTOR,
            /**
            * @property Style.CSS_CELL_SELECTED
            */
            CSS_CELL_SELECTED : defStyle.CSS_CELL_SELECTED,
            /**
            * @property Style.CSS_CELL_SELECTABLE
            */
            CSS_CELL_SELECTABLE : defStyle.CSS_CELL_SELECTABLE,
            /**
            * @property Style.CSS_CELL_RESTRICTED
            */
            CSS_CELL_RESTRICTED : defStyle.CSS_CELL_RESTRICTED,
            /**
            * @property Style.CSS_CELL_TODAY
            */
            CSS_CELL_TODAY : defStyle.CSS_CELL_TODAY,
            /**
            * @property Style.CSS_CELL_OOM
            */
            CSS_CELL_OOM : defStyle.CSS_CELL_OOM,
            /**
            * @property Style.CSS_CELL_OOB
            */
            CSS_CELL_OOB : defStyle.CSS_CELL_OOB,
            /**
            * @property Style.CSS_HEADER
            */
            CSS_HEADER : defStyle.CSS_HEADER,
            /**
            * @property Style.CSS_HEADER_TEXT
            */
            CSS_HEADER_TEXT : defStyle.CSS_HEADER_TEXT,
            /**
            * @property Style.CSS_BODY
            */
            CSS_BODY : defStyle.CSS_BODY,
            /**
            * @property Style.CSS_WEEKDAY_CELL
            */
            CSS_WEEKDAY_CELL : defStyle.CSS_WEEKDAY_CELL,
            /**
            * @property Style.CSS_WEEKDAY_ROW
            */
            CSS_WEEKDAY_ROW : defStyle.CSS_WEEKDAY_ROW,
            /**
            * @property Style.CSS_FOOTER
            */
            CSS_FOOTER : defStyle.CSS_FOOTER,
            /**
            * @property Style.CSS_CALENDAR
            */
            CSS_CALENDAR : defStyle.CSS_CALENDAR,
            /**
            * @property Style.CSS_SINGLE
            */
            CSS_SINGLE : defStyle.CSS_SINGLE,
            /**
            * @property Style.CSS_CONTAINER
            */
            CSS_CONTAINER : defStyle.CSS_CONTAINER,
            /**
            * @property Style.CSS_NAV_LEFT
            */
            CSS_NAV_LEFT : defStyle.CSS_NAV_LEFT,
            /**
            * @property Style.CSS_NAV_RIGHT
            */
            CSS_NAV_RIGHT : defStyle.CSS_NAV_RIGHT,
            /**
            * @property Style.CSS_NAV
            */
            CSS_NAV : defStyle.CSS_NAV,
            /**
            * @property Style.CSS_CLOSE
            */
            CSS_CLOSE : defStyle.CSS_CLOSE,
            /**
            * @property Style.CSS_CELL_TOP
            */
            CSS_CELL_TOP : defStyle.CSS_CELL_TOP,
            /**
            * @property Style.CSS_CELL_LEFT
            */
            CSS_CELL_LEFT : defStyle.CSS_CELL_LEFT,
            /**
            * @property Style.CSS_CELL_RIGHT
            */
            CSS_CELL_RIGHT : defStyle.CSS_CELL_RIGHT,
            /**
            * @property Style.CSS_CELL_BOTTOM
            */
            CSS_CELL_BOTTOM : defStyle.CSS_CELL_BOTTOM,
            /**
            * @property Style.CSS_CELL_HOVER
            */
            CSS_CELL_HOVER : defStyle.CSS_CELL_HOVER,
            /**
            * @property Style.CSS_CELL_HIGHLIGHT1
            */
            CSS_CELL_HIGHLIGHT1 : defStyle.CSS_CELL_HIGHLIGHT1,
            /**
            * @property Style.CSS_CELL_HIGHLIGHT2
            */
            CSS_CELL_HIGHLIGHT2 : defStyle.CSS_CELL_HIGHLIGHT2,
            /**
            * @property Style.CSS_CELL_HIGHLIGHT3
            */
            CSS_CELL_HIGHLIGHT3 : defStyle.CSS_CELL_HIGHLIGHT3,
            /**
            * @property Style.CSS_CELL_HIGHLIGHT4
            */
            CSS_CELL_HIGHLIGHT4 : defStyle.CSS_CELL_HIGHLIGHT4,
            /**
             * @property Style.CSS_WITH_TITLE
             */
            CSS_WITH_TITLE : defStyle.CSS_WITH_TITLE,
             /**
             * @property Style.CSS_FIXED_SIZE
             */
            CSS_FIXED_SIZE : defStyle.CSS_FIXED_SIZE,
             /**
             * @property Style.CSS_LINK_CLOSE
             */
            CSS_LINK_CLOSE : defStyle.CSS_LINK_CLOSE
        };
    }
720349
private DateFormat parseFormatter(Context context, Arguments args)
    {
        final String format = args.get(FORMAT_PARAM_NAME);
        final Locale locale = context.get(LOCALE);
        if (format != null)
        {
            return new SimpleDateFormat(format, locale);
        }

        final int defaultFormatStyle = parseDateFormatStyle(args);
        final int dateFormatStyle = parseDateFormatStyle(args.get(DATE_PARAM_NAME), defaultFormatStyle);
        final int timeFormatStyle = parseDateFormatStyle(args.get(TIME_PARAM_NAME), defaultFormatStyle);

        if (Mode.DATE_TIME.equals(mode))
        {
            return DateFormat.getDateTimeInstance(dateFormatStyle, timeFormatStyle, locale);
        }
        else if (Mode.DATE.equals(mode))
        {
            return DateFormat.getDateInstance(dateFormatStyle, locale);
        }
        else if (Mode.TIME.equals(mode))
        {
            return DateFormat.getTimeInstance(timeFormatStyle, locale);
        }
        return DateFormat.getInstance();
    }
1012576
function() {
			var aArguments = Array.prototype.slice.call(arguments),
				sCalendar, sKey;
			// Calendar data needs special handling, as CustomLocaleData does have one version of calendar data only
			if (aArguments[0].indexOf("ca-") == 0) {
				sCalendar = aArguments[0];
				if (sCalendar == getCLDRCalendarName()) {
					aArguments = aArguments.slice(1);
				}
			}

			sKey = aArguments.join("-");
			// first try customdata with special formatted key
			// afterwards try customdata lookup
			// afterwards try mData lookup
			var vValue = this.mCustomData[sKey];
			if (vValue == null) {
				vValue = this._getDeep(this.mCustomData, arguments);
				if (vValue == null) {
					vValue = this._getDeep(this.mData, arguments);
				}
			}

			return vValue;
		}
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);
  }
1271647
private Calendar initializeCalendar(TimeZone zone, ULocale locale) {
        if (calendar == null) {
            if(zone == null) {
                calendar = Calendar.getInstance(locale);
            } else {
                calendar = Calendar.getInstance(zone, locale);
            }
        }
        return calendar;
    }
820131
public StringBuffer format(Calendar calendar, StringBuffer buf) {
        if (mTimeZoneForced) {
            calendar.getTime(); /// LANG-538
            calendar = (Calendar) calendar.clone();
            calendar.setTimeZone(mTimeZone);
        }
        return applyRules(calendar, buf);
    }
605876
public Expression<Calendar> lt(Calendar value) {
		String valueString = "'" + getCalendarAsString(value) + "'";
		return new Expression<Calendar>(this, Operation.lt, valueString);
	}
878557
function convertRawTime(rawColumnValue, column, context)
{
  var columnScale = column.getScale();

  // the values might be big so use BigNumber to do arithmetic
  var valFracSecsBig =
      new BigNumber(rawColumnValue).times(Math.pow(10, columnScale));

  return convertRawTimestampHelper(
      valFracSecsBig,
      columnScale,
      'UTC',
      context.format).toSfTime();
}
1207576
public CurrencyDateCalculatorBuilder<E> ccy2Calendar(final HolidayCalendar<E> ccy2Calendar) {
        if (ccy2Calendar != null) {
            this.ccy2Calendar = ccy2Calendar;
        }
        return this;
    }
354600
public CurrencyDateCalculatorBuilder<E> ccy1Calendar(final HolidayCalendar<E> ccy1Calendar) {
        if (ccy1Calendar != null) {
            this.ccy1Calendar = ccy1Calendar;
        }
        return this;
    }