abstractSearch dans une date-heure datetime.datetime (cf abstractRender.dateheure)
436158
def in_dateheure(objet, pattern):
        
        if objet:
            pattern = re.sub(" ", '', pattern)
            objet_str = abstractRender.dateheure(objet)
            return bool(re.search(pattern, objet_str))
        return False
1217706
function(dateA, dateB) {
		"use strict";

		if(!(dateA instanceof Date)) {
			dateA = new Date(dateA);
		}

		if (!(dateB instanceof Date)) {
			dateB = new Date(dateB);
		}


		function normalizedMillis(date, subdomain) {
			switch(subdomain) {
			case "x_min":
			case "min":
				return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes()).getTime();
			case "x_hour":
			case "hour":
				return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours()).getTime();
			case "x_day":
			case "day":
				return new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
			case "x_week":
			case "week":
			case "x_month":
			case "month":
				return new Date(date.getFullYear(), date.getMonth()).getTime();
			default:
				return date.getTime();
			}
		}

		return normalizedMillis(dateA, this.options.subDomain) < normalizedMillis(dateB, this.options.subDomain);
	}
1072012
function getCombination (dateFilter, resolutionFilter, dataTypeFilter) {
  var c = {
    date: getFilter(date, dateFilter),
    resolution: getFilter(resolution, resolutionFilter),
    dataType: getFilter(dataType, dataTypeFilter),
    searchParameters: getSearchParameters(dateFilter, resolutionFilter, dataTypeFilter)
  };
  c.key = [c.date.key, c.resolution.key, c.dataType.key].join('_');

  return c;
}
59873
ChronoFormatter<T> with(
        Map<ChronoElement<?>, Object> outerDefaults,
        AttributeSet outerAttrs
    ) {

        AttributeSet merged = AttributeSet.merge(outerAttrs, this.globalAttributes);

        return new ChronoFormatter<>(
            new ChronoFormatter<>(this, outerDefaults),
            merged,
            merged.get(HistoricAttribute.CALENDAR_HISTORY, null));

    }
767805
function(date) {
        var dateNoTime = new Date(
            date.getFullYear(), date.getMonth(), date.getDate());
        return Math.ceil(
            (dateNoTime - new Date(date.getFullYear(), 0, 1))
            / dateutil.ONE_DAY) + 1;
    }
1062083
private DateTimeColumn fillWith(int count, Iterator<LocalDateTime> iterator, Consumer<LocalDateTime> acceptor) {
        for (int r = 0; r < count; r++) {
            if (!iterator.hasNext()) {
                break;
            }
            acceptor.accept(iterator.next());
        }
        return this;
    }
1351797
def iterate_date_values(d, start_date=None, stop_date=None, default=0):
    
    dataiter = iter(d)
    cur_day, cur_val = next(dataiter)

    start_date = start_date or cur_day

    while cur_day < start_date:
        cur_day, cur_val = next(dataiter)

    for d in iterate_date(start_date, stop_date):
        if d != cur_day:
            yield default
            continue

        yield cur_val
        try:
            cur_day, cur_val = next(dataiter)
        except StopIteration:
            if not stop_date:
                raise
718181
function getDate(node) {
    var text = getText(node);
    if (!text) {
        return undefined;
    }
    if (text.indexOf(':') > 0) {
        return new Date(text);
    }
    var bytes = new DataView(ByteUtils.arrayToBuffer(ByteUtils.base64ToBytes(text)));
    var secondsFrom00 = new Int64(bytes.getUint32(0, true), bytes.getUint32(4, true)).value;
    var diff = (secondsFrom00 - EpochSeconds) * 1000;
    return new Date(diff);
}
1187074
function (dateStr) {
            var calendar = /**@type {KISSY.Date.Gregorian}
             @ignore*/
                new GregorianCalendar(this.timezoneOffset, this.locale), i, j, tmp = {}, obeyCount = false, dateStrLen = dateStr.length, errorIndex = -1, startIndex = 0, oldStartIndex = 0, pattern = this.pattern, len = pattern.length;
            loopPattern: {
                for (i = 0; errorIndex < 0 && i < len; i++) {
                    var comp = pattern[i], text, textLen;
                    oldStartIndex = startIndex;
                    if (text = comp.text) {
                        textLen = text.length;
                        if (textLen + startIndex > dateStrLen) {
                            errorIndex = startIndex;
                        } else {
                            for (j = 0; j < textLen; j++) {
                                if (text.charAt(j) !== dateStr.charAt(j + startIndex)) {
                                    errorIndex = startIndex;
                                    break loopPattern;
                                }
                            }
                            startIndex += textLen;
                        }
                    } else if ('field' in comp) {
                        obeyCount = false;
                        var nextComp = pattern[i + 1];
                        if (nextComp) {
                            if ('field' in nextComp) {
                                obeyCount = true;
                            } else {
                                var c = nextComp.text.charAt(0);
                                if (c >= '0' && c <= '9') {
                                    obeyCount = true;
                                }
                            }
                        }
                        startIndex = parseField(calendar, dateStr, startIndex, comp.field, comp.count, this.locale, obeyCount, tmp);
                        if (startIndex === oldStartIndex) {
                            errorIndex = startIndex;
                        }
                    }
                }
            }
            if (errorIndex >= 0) {
                logger.error('error when parsing date');
                logger.error(dateStr);
                logger.error(dateStr.substring(0, errorIndex) + '^');
                return undefined;
            }
            return calendar;
        }
1358701
function () {
		var columns = this.columns,
			col = columns.length, 
			row,
			val,
			floatVal,
			trimVal,
			dateVal;
			
		while (col--) {
			row = columns[col].length;
			while (row--) {
				val = columns[col][row];
				floatVal = parseFloat(val);
				trimVal = this.trim(val);

				/*jslint eqeq: true*/
				if (trimVal == floatVal) { // is numeric
				/*jslint eqeq: false*/
					columns[col][row] = floatVal;
					
					// If the number is greater than milliseconds in a year, assume datetime
					if (floatVal > 365 * 24 * 3600 * 1000) {
						columns[col].isDatetime = true;
					} else {
						columns[col].isNumeric = true;
					}					
				
				} else { // string, continue to determine if it is a date string or really a string
					dateVal = this.parseDate(val);
					
					if (col === 0 && typeof dateVal === 'number' && !isNaN(dateVal)) { // is date
						columns[col][row] = dateVal;
						columns[col].isDatetime = true;
					
					} else { // string
						columns[col][row] = trimVal === '' ? null : trimVal;
					}
				}
				
			}
		}
	}
1128909
private DateTime providedOrDefaultFromValue(DateTime from, DateTime to,
			AggregateCounterResolution resolution) {
		if (from != null) {
			return from;
		}
		switch (resolution) {
		case minute:
			return to.minusMinutes(59);
		case hour:
			return to.minusHours(23);
		case day:
			return to.minusDays(6);
		case month:
			return to.minusMonths(11);
		case year:
			return to.minusYears(4);
		default:
			throw new IllegalStateException(
					"Shouldn't happen. Unhandled resolution: " + resolution);
		}
	}
1287326
function(d, val) {
    val = val > later.dc.extent(d)[1] ? 1 : val;
    var month = later.date.nextRollover(d, val, later.dc, later.M),
        dcMax = later.dc.extent(month)[1];

    val = val > dcMax ? 1 : val;

    var next = later.date.next(
      later.Y.val(month),
      later.M.val(month),
      val === 0 ? later.D.extent(month)[1] - 6 : 1 + (7 * (val - 1))
    );

    if(next.getTime() <= d.getTime()) {
      month = later.M.next(d, later.M.val(d)+1);

      return later.date.next(
        later.Y.val(month),
        later.M.val(month),
        val === 0 ? later.D.extent(month)[1] - 6 : 1 + (7 * (val - 1))
      );
    }

    return next;
  }
133750
public void goToDate(Calendar date) {
        mScroller.forceFinished(true);
        mCurrentScrollDirection = mCurrentFlingDirection = Direction.NONE;

        date.set(Calendar.HOUR_OF_DAY, 0);
        date.set(Calendar.MINUTE, 0);
        date.set(Calendar.SECOND, 0);
        date.set(Calendar.MILLISECOND, 0);

        if(mAreDimensionsInvalid) {
            mScrollToDay = date;
            return;
        }

        mRefreshEvents = true;

        Calendar today = Calendar.getInstance();
        today.set(Calendar.HOUR_OF_DAY, 0);
        today.set(Calendar.MINUTE, 0);
        today.set(Calendar.SECOND, 0);
        today.set(Calendar.MILLISECOND, 0);

        long day = 1000L * 60L * 60L * 24L;
        long dateInMillis = date.getTimeInMillis() + date.getTimeZone().getOffset(date.getTimeInMillis());
        long todayInMillis = today.getTimeInMillis() + today.getTimeZone().getOffset(today.getTimeInMillis());
        long dateDifference = (dateInMillis/day) - (todayInMillis/day);
        mCurrentOrigin.x = - dateDifference * (mWidthPerDay + mColumnGap);
        invalidate();
    }
674044
function(date, inst) {
			var minDate = inst.get('minDate');
			var maxDate = inst.get('maxDate');
			date = (minDate && date.compareTo(minDate) === -1 ? minDate.newDate() : date);
			date = (maxDate && date.compareTo(maxDate) === +1 ? maxDate.newDate() : date);
			return date;
		}
566076
function dateRelative(d, dRelative, arg1, arg2) {
  var adu, format, type, localeCode, fn;
  assertDateIsValid(d);
  if (isFunction(arg1)) {
    fn = arg1;
  } else {
    localeCode = arg1;
    fn = arg2;
  }
  adu = getAdjustedUnitForDate(d, dRelative);
  if (fn) {
    format = fn.apply(d, adu.concat(localeManager.get(localeCode)));
    if (format) {
      return dateFormat(d, format, localeCode);
    }
  }
  // Adjust up if time is in ms, as this doesn't
  // look very good for a standard relative date.
  if (adu[1] === 0) {
    adu[1] = 1;
    adu[0] = 1;
  }
  if (dRelative) {
    type = 'duration';
  } else if (adu[2] > 0) {
    type = 'future';
  } else {
    type = 'past';
  }
  return localeManager.get(localeCode).getRelativeFormat(adu, type);
}
1153839
def getWithDateFormat(self, name, default="", parent_search=False, multikeys_search=False):
		
		# récupération de la valeur
		value = self.get(name, default, parent_search, multikeys_search)

		# récupération d'un delta dans le nom
		#  {dd-10} donne 10 jours avant le jour d'aujourd'hui
		#  {H+12} donne 12 heures après l'heure courante
		# delta_d = int(re.findall(r"[+|-]\d+", value)[0]) if value.startswith("{dd") else 0

		# objet de date interne
		d = FastDate()

		# récupation des dates
		now = d.convert()

		tomorrow = d.tomorrow()
		yesterday = d.yesterday()

		weekday_tomorrow = d.weekday_tomorrow()
		weekday_yesterday = d.weekday_yesterday()

		weekend_tomorrow = d.weekend_tomorrow()
		weekend_yesterday = d.weekend_yesterday()

		working_tomorrow = d.working_tomorrow()
		working_yesterday = d.working_yesterday()

		# formatage de la valeur
		return value.format(
			yyyy=now.year,
			mm=now.strftime("%m"),
			dd=now.strftime("%d"),
			H=now.strftime("%H"),
			M=now.strftime("%M"),
			S=now.strftime("%S"),
			mm_human=now.strftime("%B"),

			tomorrow_yyyy=tomorrow.year,
			tomorrow_mm=tomorrow.strftime("%m"),
			tomorrow_dd=tomorrow.strftime("%d"),
			tomorrow_H=tomorrow.strftime("%H"),
			tomorrow_M=tomorrow.strftime("%M"),
			tomorrow_S=tomorrow.strftime("%S"),
			tomorrow_mm_human=tomorrow.strftime("%B"),

			yesterday_yyyy=yesterday.year,
			yesterday_mm=yesterday.strftime("%m"),
			yesterday_dd=yesterday.strftime("%d"),
			yesterday_H=yesterday.strftime("%H"),
			yesterday_M=yesterday.strftime("%M"),
			yesterday_S=yesterday.strftime("%S"),
			yesterday_mm_human=yesterday.strftime("%B"),

			weekday_yesterday_yyyy=weekday_yesterday.year,
			weekday_yesterday_mm=weekday_yesterday.strftime("%m"),
			weekday_yesterday_dd=weekday_yesterday.strftime("%d"),
			weekday_yesterday_H=weekday_yesterday.strftime("%H"),
			weekday_yesterday_M=weekday_yesterday.strftime("%M"),
			weekday_yesterday_S=weekday_yesterday.strftime("%S"),
			weekday_yesterday_mm_human=weekday_yesterday.strftime("%B"),

			weekday_tomorrow_yyyy=weekday_tomorrow.year,
			weekday_tomorrow_mm=weekday_tomorrow.strftime("%m"),
			weekday_tomorrow_dd=weekday_tomorrow.strftime("%d"),
			weekday_tomorrow_H=weekday_tomorrow.strftime("%H"),
			weekday_tomorrow_M=weekday_tomorrow.strftime("%M"),
			weekday_tomorrow_S=weekday_tomorrow.strftime("%S"),
			weekday_tomorrow_mm_human=weekday_tomorrow.strftime("%B"),

			weekend_yesterday_yyyy=weekend_yesterday.year,
			weekend_yesterday_mm=weekend_yesterday.strftime("%m"),
			weekend_yesterday_dd=weekend_yesterday.strftime("%d"),
			weekend_yesterday_H=weekend_yesterday.strftime("%H"),
			weekend_yesterday_M=weekend_yesterday.strftime("%M"),
			weekend_yesterday_S=weekend_yesterday.strftime("%S"),
			weekend_yesterday_mm_human=weekend_yesterday.strftime("%B"),

			weekend_tomorrow_yyyy=weekend_tomorrow.year,
			weekend_tomorrow_mm=weekend_tomorrow.strftime("%m"),
			weekend_tomorrow_dd=weekend_tomorrow.strftime("%d"),
			weekend_tomorrow_H=weekend_tomorrow.strftime("%H"),
			weekend_tomorrow_M=weekend_tomorrow.strftime("%M"),
			weekend_tomorrow_S=weekend_tomorrow.strftime("%S"),
			weekend_tomorrow_mm_human=weekend_tomorrow.strftime("%B"),

			working_tomorrow_yyyy=working_tomorrow.year,
			working_tomorrow_mm=working_tomorrow.strftime("%m"),
			working_tomorrow_dd=working_tomorrow.strftime("%d"),
			working_tomorrow_H=working_tomorrow.strftime("%H"),
			working_tomorrow_M=working_tomorrow.strftime("%M"),
			working_tomorrow_S=working_tomorrow.strftime("%S"),
			working_tomorrow_mm_human=working_tomorrow.strftime("%B"),

			working_yesterday_yyyy=working_yesterday.year,
			working_yesterday_mm=working_yesterday.strftime("%m"),
			working_yesterday_dd=working_yesterday.strftime("%d"),
			working_yesterday_H=working_yesterday.strftime("%H"),
			working_yesterday_M=working_yesterday.strftime("%M"),
			working_yesterday_S=working_yesterday.strftime("%S"),
			working_yesterday_mm_human=working_yesterday.strftime("%B"),
		)
1001046
function CronDate (date) {
		this.milliseconds = date.getMilliseconds();
		this.seconds = date.getSeconds() + 1;
		this.minutes = date.getMinutes();
		this.hours = date.getHours();
		this.days = date.getDate();
		this.months  = date.getMonth();
		this.years = date.getFullYear();
	}