Home | History | Annotate | Download | only in src

Lines Matching full:year

63 function DaysInYear(year) {
64 if (year % 4 != 0) return 365;
65 if ((year % 100 == 0) && (year % 400 != 0)) return 365;
70 function DayFromYear(year) {
71 return 365 * (year-1970)
72 + FLOOR((year-1969)/4)
73 - FLOOR((year-1901)/100)
74 + FLOOR((year-1601)/400);
78 function TimeFromYear(year) {
79 return msPerDay * DayFromYear(year);
94 function EquivalentYear(year) {
95 // Returns an equivalent year in the range [2008-2035] matching
96 // - leap year.
98 var time = TimeFromYear(year);
101 // Find the year in the range 2008..2037 that is equivalent mod 28.
111 // We solve this by mapping the time to a year with same leap-year-ness
112 // and same starting day for the year. The ECMAscript specification says
114 // the actual year if it is in the range 1970..2037
278 function TimeInYear(year) {
279 return DaysInYear(year) * msPerDay;
283 // Compute modified Julian day from year, month, date.
284 function ToJulianDay(year, month, date) {
285 var jy = (month > 1) ? year : year - 1;
324 // Constructor for creating objects holding year, month, and date.
326 function DayTriplet(year, month, date) {
327 this.year = year;
335 // Compute year, month, and day from modified Julian day.
376 // Compute number of days given a year, month, date.
382 function MakeDay(year, month, date) {
383 if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) return $NaN;
386 year = TO_INTEGER(year);
390 // Overflow months into year.
391 year = year + FLOOR(month/12);
398 return ToJulianDay(year, month, date) - kDayZeroInJulianDay;
423 // Cached year when interpreting the time as a local time. Only
425 year: $NaN,
431 %SetCode($Date, function(year, month, date, hours, minutes, seconds, ms) {
444 if (IS_NUMBER(year)) {
445 value = TimeClip(year);
447 } else if (IS_STRING(year)) {
451 if (cache.string === year) {
454 value = DateParse(year);
457 cache.year = YEAR_FROM_TIME(LocalTimeNoCheck(value));
458 cache.string = year;
470 var time = ToPrimitive(year, NUMBER_HINT);
475 year = ToNumber(year);
482 year = (!NUMBER_IS_NAN(year) && 0 <= TO_INTEGER(year) && TO_INTEGER(year) <= 99)
483 ? 1900 + TO_INTEGER(year) : year;
484 var day = MakeDay(year, month, date);
557 if (cache.time === t) return cache.year;
614 + YMD.year;
627 + YMD.year;
691 function DateUTC(year, month, date, hours, minutes, seconds, ms) {
692 year = ToNumber(year);
700 year = (!NUMBER_IS_NAN(year) && 0 <= TO_INTEGER(year) && TO_INTEGER(year) <= 99)
701 ? 1900 + TO_INTEGER(year) : year;
702 var day = MakeDay(year, month, date);
1018 function DateSetFullYear(year, month, date) {
1021 year = ToNumber(year);
1025 var day = MakeDay(year, month, date);
1031 function DateSetUTCFullYear(year, month, date) {
1035 year = ToNumber(year);
1038 var day = MakeDay(year, month, date);
1065 function DateSetYear(year) {
1068 year = ToNumber(year);
1069 if (NUMBER_IS_NAN(year)) return %_SetValueOf(this, $NaN);
1070 year = (0 <= TO_INTEGER(year) && TO_INTEGER(year) <= 99)
1071 ? 1900 + TO_INTEGER(year) : year;
1072 var day = MakeDay(year, MONTH_FROM_TIME(t), DATE_FROM_TIME(t));