Wraps ::Date.new to play nice with ArgumentError.

 @param [Array<Integer>] atoms The date atoms.

 @return [::Date]
174905
def compose(atoms)
      ::Date.new(*atoms)
    rescue ArgumentError
      raise ISO8601::Errors::RangeError, @original
    end
586719
def date_to_um_date(date):
    

    assert date.hour == 0 and date.minute == 0 and date.second == 0

    return [date.year, date.month, date.day, 0, 0, 0]
373747
def atomize(input)
      _, time, zone = parse_timezone(input)
      _, hour, separator, minute, second = parse_time(time)

      raise(ISO8601::Errors::UnknownPattern, @original) if hour.nil?

      @separator = separator
      require_separator = require_separator(minute)

      hour = hour.to_i
      minute = minute.to_i
      second = parse_second(second)

      atoms = [hour, minute, second, zone].compact

      raise(ISO8601::Errors::UnknownPattern, @original) unless valid_zone?(zone, require_separator)

      atoms
    end
1110899
def imply_dates
      return unless !@properties['end'].nil? && !@properties['start'].nil?

      start_date = nil

      @properties['start'].each do |start_val|
        if start_val =~ /^(\d{4}-[01]\d-[0-3]\d)/
          start_date = Regexp.last_match(1) if start_date.nil?
        elsif start_val =~ /^(\d{4}-[0-3]\d\d)/
          start_date = Regexp.last_match(1) if start_date.nil?
        end
      end

      unless start_date.nil?
        @properties['end'].map! do |end_val|
          if end_val.match?(/^\d{4}-[01]\d-[0-3]\d/)
            end_val
          elsif end_val.match?(/^\d{4}-[0-3]\d\d/)
            end_val
          else
            start_date + ' ' + end_val
          end
        end
      end
    end
30991
def propagate(self, date):
        

        if self.propagator.orbit is not self:
            self.propagator.orbit = self

        return self.propagator.propagate(date)
1006599
function (val) {
/*Line 387 - 'Atom.js' */        if (!val)
/*Line 388 - 'Atom.js' */            return "";
/*Line 389 - 'Atom.js' */        if (val.constructor == String) {
/*Line 390 - 'Atom.js' */            if (/^\/date\(/gi.test(val)) {
/*Line 391 - 'Atom.js' */                val = val.substr(6);
/*Line 392 - 'Atom.js' */                val = new Date(parseInt(val,10));
/*Line 393 - 'Atom.js' */            } else {
/*Line 394 - 'Atom.js' */                throw new Error("Invalid date format " + val);
/*Line 395 - 'Atom.js' */            }
/*Line 396 - 'Atom.js' */        }
/*Line 397 - 'Atom.js' */        //var dt = new Date();
        
/*Line 399 - 'Atom.js' */        return this.m_names[val.getMonth()] + " " + val.getDate() + ", " + val.getFullYear();
/*Line 400 - 'Atom.js' */    }
733188
function clampDate(date, minDate, maxDate) {
       var boundDate = date;
       if (minDate && date < minDate) {
         boundDate = new Date(minDate.getTime());
       }
       if (maxDate && date > maxDate) {
         boundDate = new Date(maxDate.getTime());
       }
       return boundDate;
     }
208549
function parseDate(s, ignoreTimezone) { // ignoreTimezone defaults to true
	if (typeof s == 'object') { // already a Date object
		return s;
	}
	if (typeof s == 'number') { // a UNIX timestamp
		return new Date(s * 1000);
	}
	if (typeof s == 'string') {
		if (s.match(/^\d+(\.\d+)?$/)) { // a UNIX timestamp
			return new Date(parseFloat(s) * 1000);
		}
		if (ignoreTimezone === undefined) {
			ignoreTimezone = true;
		}
		return parseISO8601(s, ignoreTimezone) || (s ? new Date(s) : null);
	}
	// TODO: never return invalid dates (like from new Date(<string>)), return null instead
	return null;
}
1370704
def dates(self, desc=None):
        ''''''
        c = self.dateinverse
        for key in self.keys(desc=desc):
            yield c(key)
671362
def get_utc
      (puts Const::MSG_ERR_1; return) unless @arg =~ /^\d{8}$|^\d{14,}$/
      year, month, day = @arg[ 0, 4].to_i, @arg[ 4, 2].to_i, @arg[ 6, 2].to_i
      hour, min,   sec = @arg[ 8, 2].to_i, @arg[10, 2].to_i, @arg[12, 2].to_i
      usec = @arg.split(//).size > 14 ? @arg[14..-1].to_s : "0"
      (puts Const::MSG_ERR_2; return) unless Date.valid_date?(year, month, day)
      (puts Const::MSG_ERR_2; return) if hour > 23 || min > 59 || sec >= 60.0
      d = usec.to_s.split(//).size
      return Time.new(
        year, month, day, hour, min, sec + Rational(usec.to_i, 10 ** d), "+00:00"
      )
    end
1053563
def propagate(self, date):
        

        if type(date) is timedelta:
            date = self.orbit.date + date

        # Convert the date to a tuple usable by the sgp4 library
        _date = [float(x) for x in "{:%Y %m %d %H %M %S.%f}".format(date).split()]
        p, v = self.tle.propagate(*_date)

        # Convert from km to meters
        result = [x * 1000 for x in p + v]

        return self.orbit.__class__(
            date,
            result,
            'cartesian',
            'TEME',
            self.__class__(),
            **self.orbit.complements
        )
281178
def component_on_date(self, date: datetime.date) -> Optional["Interval"]:
        
        return self.intersection(Interval.wholeday(date))
631274
def dates(date_range)
      if date_range.is_a? String

        # assume the user knows what she is doing if passed a string
        @query[:params][:date] = date_range
      elsif date_range.is_a? Range
        start = date_range.first
        last = date_range.last
        @query[:params][:date] = "#{start.strftime("%YM%m")}:#{last.strftime("%YM%m")}"
      end
      self
    end
1291613
function (v) {
/*Line 426 - 'Atom.js' */        var d = AtomDate.parse(v);
/*Line 427 - 'Atom.js' */        return {
/*Line 428 - 'Atom.js' */            Year: d.getFullYear(),
/*Line 429 - 'Atom.js' */            Month: d.getMonth() + 1,
/*Line 430 - 'Atom.js' */            Date: d.getDate(),
/*Line 431 - 'Atom.js' */            Hours: d.getHours(),
/*Line 432 - 'Atom.js' */            Minutes: d.getMinutes(),
/*Line 433 - 'Atom.js' */            Seconds: d.getSeconds(),
/*Line 434 - 'Atom.js' */            Offset: AtomDate.zoneOffsetMinutes
/*Line 435 - 'Atom.js' */        };
/*Line 436 - 'Atom.js' */    }
857456
@Override
    public ElementOperator<PlainDate> newValue(V value) {

        return new DateOperator(this, ElementOperator.OP_NEW_VALUE, value);

    }
432186
def fmt_date(date)
      return nil if date.blank?
      return nil unless (date.is_a?(String) || date.is_a?(Date) || date.is_a?(Time))
      unless date.is_a?(String)
        date = date.to_s(:date4)
      end
      m,d,y = date.split('/')
      "#{m.to_i}/#{d.to_i}/#{y.to_i}"
    end
356466
function parseNthDay(val) {
      var atoms = val.split('#');
      if (atoms.length > 1) {
        var nthValue = +atoms[atoms.length - 1];
        if(/,/.test(val)) {
          throw new Error('Constraint error, invalid dayOfWeek `#` and `,` '
            + 'special characters are incompatible');
        }
        if(/\//.test(val)) {
          throw new Error('Constraint error, invalid dayOfWeek `#` and `/` '
            + 'special characters are incompatible');
        }
        if(/-/.test(val)) {
          throw new Error('Constraint error, invalid dayOfWeek `#` and `-` '
            + 'special characters are incompatible');
        }
        if (atoms.length > 2 || safeIsNaN(nthValue) || (nthValue < 1 || nthValue > 5)) {
          throw new Error('Constraint error, invalid dayOfWeek occurrence number (#)');
        }
        
        options.nthDayOfWeek = nthValue;
        return atoms[0];
      }
      return val;
    }