Lines Matching refs:date
35 // This file contains date support implemented in JavaScript.
41 const $Date = global.Date;
45 throw new $TypeError('this is not a Date object.');
339 // Compute number of days given a year, month, date.
340 // Note that month and date can lie outside the normal range.
345 function MakeDay(year, month, date) {
346 if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) return $NaN;
351 date = TO_INTEGER_MAP_MINUS_ZERO(date);
355 date < kMinDate || date > kMaxDate) {
359 // Now we rely on year, month and date being SMIs.
360 return %DateMakeDay(year, month, date);
385 // The Date cache is used to limit the cost of parsing the same Date
398 %SetCode($Date, function(year, month, date, hours, minutes, seconds, ms) {
401 return (new $Date()).toString();
415 // Probe the Date cache. If we already have a time value for the
432 // Date objects which will lose precision when the Date
433 // constructor is called with another Date object as its
435 // which is the default for everything else than Date objects.
444 date = argc > 2 ? ToNumber(date) : 1;
451 var day = MakeDay(year, month, date);
459 %FunctionSetPrototype($Date, new $Date($NaN));
530 // Reused output buffer. Used when parsing date strings.
540 var date = MakeDate(day, time);
543 return TimeClip(UTC(date));
545 return TimeClip(date - arr[7] * 1000);
551 function DateUTC(year, month, date, hours, minutes, seconds, ms) {
555 date = argc > 2 ? ToNumber(date) : 1;
562 var day = MakeDay(year, month, date);
866 function DateSetDate(date) {
868 date = ToNumber(date);
869 var day = MakeDay(YearFromTime(t), MonthFromTime(t), date);
875 function DateSetUTCDate(date) {
877 date = ToNumber(date);
878 var day = MakeDay(YearFromTime(t), MonthFromTime(t), date);
884 function DateSetMonth(month, date) {
887 date = %_ArgumentsLength() < 2 ? NAN_OR_DATE_FROM_TIME(t) : ToNumber(date);
888 var day = MakeDay(YearFromTime(t), month, date);
894 function DateSetUTCMonth(month, date) {
897 date = %_ArgumentsLength() < 2 ? NAN_OR_DATE_FROM_TIME(t) : ToNumber(date);
898 var day = MakeDay(YearFromTime(t), month, date);
904 function DateSetFullYear(year, month, date) {
910 date = argc < 3 ? DateFromTime(t) : ToNumber(date);
911 var day = MakeDay(year, month, date);
917 function DateSetUTCFullYear(year, month, date) {
923 date = argc < 3 ? DateFromTime(t) : ToNumber(date);
924 var day = MakeDay(year, month, date);
1030 // Reset the date cache:
1041 // Setup non-enumerable properties of the Date object itself.
1042 InstallFunctions($Date, DONT_ENUM, $Array(
1048 // Setup non-enumerable constructor property of the Date prototype object.
1049 %SetProperty($Date.prototype, "constructor", $Date, DONT_ENUM);
1051 // Setup non-enumerable functions of the Date prototype object and
1053 InstallFunctionsOnHiddenPrototype($Date.prototype, DONT_ENUM, $Array(