Home | History | Annotate | Download | only in src

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.');
283 // Compute modified Julian day from year, month, date.
284 function ToJulianDay(year, month, date) {
288 return FLOOR(FLOOR(365.25*jy) + FLOOR(30.6001*jm) + date + 1720995) + 2 - ja + FLOOR(0.25*ja);
324 // Constructor for creating objects holding year, month, and date.
326 function DayTriplet(year, month, date) {
329 this.date = date;
376 // Compute number of days given a year, month, date.
377 // Note that month and date can lie outside the normal range.
382 function MakeDay(year, month, date) {
383 if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) return $NaN;
388 date = TO_INTEGER(date);
398 return ToJulianDay(year, month, date) - kDayZeroInJulianDay;
418 // The Date cache is used to limit the cost of parsing the same Date
431 %SetCode($Date, function(year, month, date, hours, minutes, seconds, ms) {
434 return (new $Date()).toString();
448 // Probe the Date cache. If we already have a time value for the
465 // Date objects which will lose precision when the Date
466 // constructor is called with another Date object as its
468 // which is the default for everything else than Date objects.
477 date = argc > 2 ? ToNumber(date) : 1;
484 var day = MakeDay(year, month, date);
597 %FunctionSetPrototype($Date, new $Date($NaN));
613 + TwoDigitString(YMD.date) + ' '
626 + TwoDigitString(YMD.date) + ', '
670 // Reused output buffer. Used when parsing date strings.
680 var date = MakeDate(day, time);
683 return TimeClip(UTC(date));
685 return TimeClip(date - arr[6] * 1000);
691 function DateUTC(year, month, date, hours, minutes, seconds, ms) {
695 date = argc > 2 ? ToNumber(date) : 1;
702 var day = MakeDay(year, month, date);
980 function DateSetDate(date) {
982 date = ToNumber(date);
983 var day = MakeDay(YEAR_FROM_TIME(t), MONTH_FROM_TIME(t), date);
989 function DateSetUTCDate(date) {
991 date = ToNumber(date);
992 var day = MakeDay(YEAR_FROM_TIME(t), MONTH_FROM_TIME(t), date);
998 function DateSetMonth(month, date) {
1001 date = %_ArgumentsLength() < 2 ? GetDateFrom(this) : ToNumber(date);
1002 var day = MakeDay(YEAR_FROM_TIME(t), month, date);
1008 function DateSetUTCMonth(month, date) {
1011 date = %_ArgumentsLength() < 2 ? GetUTCDateFrom(this) : ToNumber(date);
1012 var day = MakeDay(YEAR_FROM_TIME(t), month, date);
1018 function DateSetFullYear(year, month, date) {
1024 date = argc < 3 ? DATE_FROM_TIME(t) : ToNumber(date);
1025 var day = MakeDay(year, month, date);
1031 function DateSetUTCFullYear(year, month, date) {
1037 date = argc < 3 ? DATE_FROM_TIME(t) : ToNumber(date);
1038 var day = MakeDay(year, month, date);
1114 // Setup non-enumerable properties of the Date object itself.
1115 InstallFunctions($Date, DONT_ENUM, $Array(
1121 // Setup non-enumerable constructor property of the Date prototype object.
1122 %SetProperty($Date.prototype, "constructor", $Date, DONT_ENUM);
1124 // Setup non-enumerable functions of the Date prototype object and
1126 InstallFunctionsOnHiddenPrototype($Date.prototype, DONT_ENUM, $Array(