Utility to create a time sheet URL with optional date parameters.
357142
def _timesheet_url(url_name, pk, date=None):
    """"""
    url = reverse(url_name, args=(pk,))
    if date:
        params = {'month': date.month, 'year': date.year}
        return '?'.join((url, urlencode(params)))
    return url
22545
public static JTimePopup createTimePopup(String strDateParam, Date dateTarget, Component button)
    {
        return JTimePopup.createTimePopup(null, dateTarget, button, null);
    }
1351371
function buildUrl(urlPattern, customParams) {
    var url = formatUrl.apply(null, urlPattern);

    url = appendParams(url, customParams);
    return url;
  }
1132450
def datetime_to_http_date(the_datetime):
    
    timeval = calendar.timegm(the_datetime.utctimetuple())
    return formatdate(timeval=timeval,
                      localtime=False,
                      usegmt=True)
287512
function (o) {
			o = o || {};
			var tmp_args = arguments;

			if (typeof(o) === 'string') {
				if (o === 'getDate'  || (o === 'option' && tmp_args.length === 2 && typeof (tmp_args[1]) === 'string')) {
					return $.fn.datepicker.apply($(this[0]), tmp_args);
				} else {
					return this.each(function () {
						var $t = $(this);
						$t.datepicker.apply($t, tmp_args);
					});
				}
			} else {
				return this.each(function () {
					var $t = $(this);
					$t.datepicker($.timepicker._newInst($t, o)._defaults);
				});
			}
		}
501309
def parse_and_normalize_url_date(date_str):
    
    if date_str is None:
        return None
    try:
        return d1_common.date_time.dt_from_iso8601_str(date_str)
    except d1_common.date_time.iso8601.ParseError as e:
        raise d1_common.types.exceptions.InvalidRequest(
            0,
            'Invalid date format for URL parameter. date="{}" error="{}"'.format(
                date_str, str(e)
            ),
        )
666571
def write_timestamp(self, v):
        """"""
        self.out.write(pack('>Q', long_t(calendar.timegm(v.utctimetuple()))))
706410
def write_checktime (self, url_data):
        """"""
        self.writeln(u"<tr><td>"+self.part("checktime")+u"</td><td>"+
                     (_("%.3f seconds") % url_data.checktime)+u"</td></tr>")
93525
def rfc1123_date(timestamp=None):
    """"""
    if timestamp is None:
        timestamp = time.time()
    timestamp = int(timestamp)
    global _cached_timestamp, _cached_datestring
    if timestamp != _cached_timestamp:
        # The time stamp must be GMT, and cannot be localized.
        tm = time.gmtime(timestamp)
        s = rfc1123_fmt.replace('%a', weekdays[tm.tm_wday]) \
                       .replace('%b', months[tm.tm_mon-1])
        _cached_datestring = time.strftime(s, tm)
        _cached_timestamp = timestamp
    return _cached_datestring
476137
def options(self, url, url_params=empty.dict, headers=empty.dict, timeout=None, **params):
        """"""
        return self.request('OPTIONS', url=url, headers=headers, timeout=timeout, **params)
1355190
function dateGetter(name, size, offset, trim, negWrap) {
    if (offset === void 0) { offset = 0; }
    if (trim === void 0) { trim = false; }
    if (negWrap === void 0) { negWrap = false; }
    return function (date, locale) {
        var /** @type {?} */ part = getDatePart(name, date, size);
        if (offset > 0 || part > -offset) {
            part += offset;
        }
        if (name === DateType.Hours && part === 0 && offset === -12) {
            part = 12;
        }
        return padNumber(part, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign), trim, negWrap);
    };
}
271637
def draw_datetime(f, col_or_sym, options={})
      col_name  = get_column_name(col_or_sym)
      f.text_field(col_name,
          value: datetime_fmt(f.object.send(col_name)))
    end
978257
def get_week_URL(date, day=0):
    
    if day < 1:
        day = 1
    date = datetime(year=date.year, month=date.month, day=day, tzinfo=utc)
    return reverse('calendar_week', kwargs={'year': date.isocalendar()[0],
                                            'week': date.isocalendar()[1]})
1209671
public static DateTime toDateTime(Locale locale, String str, TimeZone tz, boolean useCommomDateParserAsWell) throws PageException {

	DateTime dt = toDateTime(locale, str, tz, null, useCommomDateParserAsWell);
	if (dt == null) {
	    String prefix = locale.getLanguage() + "-" + locale.getCountry() + "-";
	    throw new ExpressionException("can't cast [" + str + "] to date value",
		    "to add custom formats for " + LocaleFactory.toString(locale) + ", create/extend on of the following files [" + prefix + "datetime.df (for date time formats), "
			    + prefix + "date.df (for date formats) or " + prefix + "time.df (for time formats)] in the following directory [<context>/lucee/locales]." + "");

	    // throw new ExpressionException("can't cast ["+str+"] to date value");
	}
	return dt;
    }
840784
function iterateOverDateParams(params, fn, startIndex, endIndex) {

  function run(name, unit, i) {
    var val = getDateParam(params, name);
    if (isDefined(val)) {
      fn(name, val, unit, i);
    }
  }

  iterateOverDateUnits(function (unit, i) {
    var result = run(unit.name, unit, i);
    if (result !== false && i === DAY_INDEX) {
      // Check for "weekday", which has a distinct meaning
      // in the context of setting a date, but has the same
      // meaning as "day" as a unit of time.
      result = run('weekday', unit, i);
    }
    return result;
  }, startIndex, endIndex);

}
920205
def prepare_url(method, params = {})
			timestamp = Time.now.utc.strftime('%Y%m%d%H%M%S')
			params[:method] = method
			params[:appid] = @appid
			params[:ts] = timestamp
			html_params = params.map { |k,v| "#{k.to_s}=#{v}" }.join("&")

			raw = @secret + params.keys.
					sort{ |a,b| a.to_s.downcase <=> b.to_s.downcase }.
					map{ |k| "#{k.to_s}#{params[k]}" }.
					join

			sig = Digest::MD5.hexdigest(raw)
			"http://cloud.scorm.com/api?#{html_params}&sig=#{sig}"
		end
151041
def _get_url_params(self, shorten=True):
        """"""
        cable = True if self.category == 'cable' else False
        url_date = convert_month(self.date, shorten=shorten, cable=cable)

        return [
            BASE_URL,
            self.weekday.lower(),
            self.category + '-ratings',
            url_date.replace(' ', '-')
        ]