Builds the date argument for event rules.
320353
def _build_date(date, kwargs):
    
    if date is None:
        if not kwargs:
            raise ValueError('Must pass a date or kwargs')
        else:
            return datetime.date(**kwargs)

    elif kwargs:
        raise ValueError('Cannot pass kwargs and a date')
    else:
        return date
1107571
def event_date(self, event_date):
        
        if not self.can_update():
            self._tcex.handle_error(910, [self.type])

        event_date = self._utils.format_datetime(event_date, date_format='%Y-%m-%dT%H:%M:%SZ')
        self._data['eventDate'] = event_date
        request = {'eventDate': event_date}
        return self.tc_requests.update(self.api_type, self.api_sub_type, self.unique_id, request)
483179
protected String date (int style, Object arg)
    {
        Date when = massageDate(arg);
        if (when == null) {
            return "<!" + arg + ">";
        }
        return DateFormat.getDateInstance(style, getLocale()).format(when);
    }
186066
def date(self) -> Optional[DateHeader]:
        """"""
        try:
            return cast(DateHeader, self[b'date'][0])
        except (KeyError, IndexError):
            return None
431326
def build_year_rules(rule, expression)
      rule = rule.year(*expression.year) unless expression.year.blank?
      rule = rule.month_of_year(*expression.month) unless expression.month.blank?

      rule
    end
385511
public static boolean eventDateValid(String eventDate) {
    	boolean result = false; 
    	if (extractDate(eventDate)!=null) { 
    		result = true;
    	} else { 
    		Interval interval = extractInterval(eventDate);
    		if (interval!=null) { 
    			if (interval.getStart().isBefore(interval.getEnd())) { 
    			   result = true;
    			}
    		}
    	}
    	return result;
    }
1306694
function coerceDate(value) {
    if (value instanceof Date) {
        return value;
    }

    let timestamp = Date.parse(value);

    if (!isNaN(timestamp)) {
        return new Date(timestamp);
    }

    return value;
}
1359124
function date(event) {
    var result = this.lib.expiry(this.month.get('value'), this.year.get('value'))
      , className = result ? 'valid' : 'invalid';

    //
    // Update both select boxes.
    //
    this.month.removeClass('invalid').addClass(className);
    this.year.removeClass('invalid').addClass(className);
  }
544490
private static void appendDate(StringBuilder message)
    {
        final String date = DATE_TIME_FORMAT.format(Calendar.getInstance().getTime());
        message.append(date);
        message.append(Constant.SPACE);
    }
716473
@Override
    Map<String, Object> constructRequestArgs() {
        Map<String, Object> queryArgs = new HashMap<String, Object>();

        if (eventCollection != null) {
            queryArgs.put(KeenQueryConstants.EVENT_COLLECTION, eventCollection);
        }

        if (interval != null) {
            queryArgs.put(KeenQueryConstants.INTERVAL, interval);
        }

        // This will be overwritten by the timeframe if provided. Timezone is only applicable for
        // a relative timeframe, and so this property will go away in the future.
        if (timezone != null) {
            queryArgs.put(KeenQueryConstants.TIMEZONE, timezone);
        }

        if (groupBy != null) {
            queryArgs.put(KeenQueryConstants.GROUP_BY, groupBy);
        }

        if (maxAge != null) {
            queryArgs.put(KeenQueryConstants.MAX_AGE, maxAge);
        }

        if (targetProperty != null) {
            queryArgs.put(KeenQueryConstants.TARGET_PROPERTY, targetProperty);
        }

        if (percentile != null) {
            queryArgs.put(KeenQueryConstants.PERCENTILE, percentile);
        }

        if (filters != null) {
            queryArgs.put(KeenQueryConstants.FILTERS, filters.constructParameterRequestArgs());
        }

        if (timeframe != null) {
            queryArgs.putAll(timeframe.constructTimeframeArgs());
        }

        return queryArgs;
    }
1077999
def set_creation_date(self, p_date=date.today()):
        
        self.fields['creationDate'] = p_date

        # not particularly pretty, but inspired by
        # http://bugs.python.org/issue1519638 non-existent matches trigger
        # exceptions, hence the lambda
        self.src = re.sub(
            r'^(x \d{4}-\d{2}-\d{2} |\([A-Z]\) )?(\d{4}-\d{2}-\d{2} )?(.*)$',
            lambda m:
            u"{}{} {}".format(m.group(1) or '', p_date.isoformat(),
                                m.group(3)), self.src)
998794
def schema_event_items():
        """"""
        return {
            'timestamp': And(int, lambda n: n > 0),
            Optional('information', default={}): {
                Optional(Regex(r'([a-z][_a-z]*)')): object
            }
        }
703917
public final void setDateDetailsCallback(Callback<DateDetailsParameter, Boolean> callback) {
        requireNonNull(callback);
        dateDetailsCallbackProperty().set(callback);
    }
115071
def build_date(self):
        
        # pylint: disable=len-as-condition
        if len(self.dutinformation) > 0 and (self.dutinformation.get(0).build is not None):
            return self.dutinformation.get(0).build.date
        return None
52396
function dispatch(context, event, args) {
    var date = new Date()
    for (var i = 0; i < listeners.length; i++)
      listeners[i](context, event, date, args)
  }
1339990
function buildISOLocalDate (date) {
	var out;
	if (date.year !== undefined) {
		out = date.year;
	}
	if (date.month !== undefined) {
		out += '-' + pad(date.month + 1);
	}
	if (date.day !== undefined) {
		out += '-' + pad(date.day);
	}
	if (date.hour !== undefined) {
		out += 'T' + pad(date.hour);
	}
	if (date.minute !== undefined) {
		out += ':' + pad(date.minute);
	}
	if (date.second !== undefined) {
		out += ':' + pad(date.second);
	}
	return out;

	function pad(number) {
		if (number < 10) {
			return '0' + number;
		}
		return number;
	}

}
334882
function (args) {
                args.HasError = false;
                args.ErrorMessage = "";

                var greaterThanToday = new VacationApproval.FromToDateValidator();
                greaterThanToday.FromOperator = 4 /* GreaterThanEqual */;
                greaterThanToday.From = new Date();
                greaterThanToday.ToOperator = 1 /* LessThanEqual */;
                greaterThanToday.To = this.Duration.From;
                greaterThanToday.IgnoreTime = true;

                if (!greaterThanToday.isAcceptable(this.Approval.ApprovedDate)) {
                    args.HasError = true;
                    args.ErrorMessage = greaterThanToday.customMessage({
                        "Format": "MM/DD/YYYY",
                        "Msg": "Date must be between ('{From}' - '{To}')."
                    }, greaterThanToday);
                    args.TranslateArgs = { TranslateId: greaterThanToday.tagName, MessageArgs: greaterThanToday, CustomMessage: greaterThanToday.customMessage };
                    return;
                }
            }