示例#1
0
    @Override
    public D withValue(D context, Long value, boolean lenient) {

      long utcDays =
          MathUtils.safeSubtract(
              EpochDays.UNIX.transform(value.longValue(), this.element), UTC_OFFSET);

      return this.calsys.transform(utcDays);
    }
示例#2
0
    @Override
    public boolean isValid(D context, Long value) {

      long days =
          MathUtils.safeSubtract(
              EpochDays.UNIX.transform(value.longValue(), this.element), UTC_OFFSET);

      return ((days <= this.calsys.getMaximumSinceUTC())
          && (days >= this.calsys.getMinimumSinceUTC()));
    }