Lines Matching full:date
8 #include "src/date/date.h"
9 #include "src/date/dateparser-inl.h"
15 #include "src/objects/js-date-time-format.h"
23 // ES6 section 20.3 Date Objects
27 // ES6 section 20.3.1.16 Date Time String Format
45 double date = MakeDate(day, time); in ParseDateTimeString() local
47 if (date >= -DateCache::kMaxTimeBeforeUTCInMs && in ParseDateTimeString()
48 date <= DateCache::kMaxTimeBeforeUTCInMs) { in ParseDateTimeString()
49 date = isolate->date_cache()->ToUTC(static_cast<int64_t>(date)); in ParseDateTimeString()
54 date -= out[DateParser::UTC_OFFSET] * 1000.0; in ParseDateTimeString()
56 return DateCache::TimeClip(date); in ParseDateTimeString()
59 Object SetLocalDateValue(Isolate* isolate, Handle<JSDate> date, in SetLocalDateValue() argument
67 return *JSDate::SetValue(date, DateCache::TimeClip(time_val)); in SetLocalDateValue()
72 // ES #sec-date-constructor
113 double date = 1.0, hours = 0.0, minutes = 0.0, seconds = 0.0, ms = 0.0; in BUILTIN() local
118 date = date_object->Number(); in BUILTIN()
148 double const day = MakeDay(year, month, date); in BUILTIN()
161 // ES6 section 20.3.3.1 Date.now ( )
167 // ES6 section 20.3.3.2 Date.parse ( string )
177 // ES6 section 20.3.3.4 Date.UTC (year,month,date,hours,minutes,seconds,ms)
182 double month = 0.0, date = 1.0, hours = 0.0, minutes = 0.0, seconds = 0.0, in BUILTIN() local
198 date = date_object->Number(); in BUILTIN()
231 double const day = MakeDay(year, month, date); in BUILTIN()
237 // ES6 section 20.3.4.20 Date.prototype.setDate ( date )
240 CHECK_RECEIVER(JSDate, date, "Date.prototype.setDate"); in BUILTIN()
244 double time_val = date->value().Number(); in BUILTIN()
254 return SetLocalDateValue(isolate, date, time_val); in BUILTIN()
257 // ES6 section 20.3.4.21 Date.prototype.setFullYear (year, month, date)
260 CHECK_RECEIVER(JSDate, date, "Date.prototype.setFullYear"); in BUILTIN()
267 if (!std::isnan(date->value().Number())) { in BUILTIN()
268 int64_t const time_ms = static_cast<int64_t>(date->value().Number()); in BUILTIN()
292 return SetLocalDateValue(isolate, date, time_val); in BUILTIN()
295 // ES6 section 20.3.4.22 Date.prototype.setHours(hour, min, sec, ms)
298 CHECK_RECEIVER(JSDate, date, "Date.prototype.setHours"); in BUILTIN()
304 double time_val = date->value().Number(); in BUILTIN()
333 return SetLocalDateValue(isolate, date, time_val); in BUILTIN()
336 // ES6 section 20.3.4.23 Date.prototype.setMilliseconds(ms)
339 CHECK_RECEIVER(JSDate, date, "Date.prototype.setMilliseconds"); in BUILTIN()
343 double time_val = date->value().Number(); in BUILTIN()
354 return SetLocalDateValue(isolate, date, time_val); in BUILTIN()
357 // ES6 section 20.3.4.24 Date.prototype.setMinutes ( min, sec, ms )
360 CHECK_RECEIVER(JSDate, date, "Date.prototype.setMinutes"); in BUILTIN()
365 double time_val = date->value().Number(); in BUILTIN()
389 return SetLocalDateValue(isolate, date, time_val); in BUILTIN()
392 // ES6 section 20.3.4.25 Date.prototype.setMonth ( month, date )
395 CHECK_RECEIVER(JSDate, this_date, "Date.prototype.setMonth"); in BUILTIN()
411 Handle<Object> date = args.at(2); in BUILTIN() local
412 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, date, in BUILTIN()
413 Object::ToNumber(isolate, date)); in BUILTIN()
414 dt = date->Number(); in BUILTIN()
421 // ES6 section 20.3.4.26 Date.prototype.setSeconds ( sec, ms )
424 CHECK_RECEIVER(JSDate, date, "Date.prototype.setSeconds"); in BUILTIN()
429 double time_val = date->value().Number(); in BUILTIN()
447 return SetLocalDateValue(isolate, date, time_val); in BUILTIN()
450 // ES6 section 20.3.4.27 Date.prototype.setTime ( time )
453 CHECK_RECEIVER(JSDate, date, "Date.prototype.setTime"); in BUILTIN()
457 return *JSDate::SetValue(date, DateCache::TimeClip(value->Number())); in BUILTIN()
460 // ES6 section 20.3.4.28 Date.prototype.setUTCDate ( date )
463 CHECK_RECEIVER(JSDate, date, "Date.prototype.setUTCDate"); in BUILTIN()
467 if (std::isnan(date->value().Number())) return date->value(); in BUILTIN()
468 int64_t const time_ms = static_cast<int64_t>(date->value().Number()); in BUILTIN()
475 return *JSDate::SetValue(date, DateCache::TimeClip(time_val)); in BUILTIN()
478 // ES6 section 20.3.4.29 Date.prototype.setUTCFullYear (year, month, date)
481 CHECK_RECEIVER(JSDate, date, "Date.prototype.setUTCFullYear"); in BUILTIN()
488 if (!std::isnan(date->value().Number())) { in BUILTIN()
489 int64_t const time_ms = static_cast<int64_t>(date->value().Number()); in BUILTIN()
512 return *JSDate::SetValue(date, DateCache::TimeClip(time_val)); in BUILTIN()
515 // ES6 section 20.3.4.30 Date.prototype.setUTCHours(hour, min, sec, ms)
518 CHECK_RECEIVER(JSDate, date, "Date.prototype.setUTCHours"); in BUILTIN()
524 double time_val = date->value().Number(); in BUILTIN()
552 return *JSDate::SetValue(date, DateCache::TimeClip(time_val)); in BUILTIN()
555 // ES6 section 20.3.4.31 Date.prototype.setUTCMilliseconds(ms)
558 CHECK_RECEIVER(JSDate, date, "Date.prototype.setUTCMilliseconds"); in BUILTIN()
562 double time_val = date->value().Number(); in BUILTIN()
572 return *JSDate::SetValue(date, DateCache::TimeClip(time_val)); in BUILTIN()
575 // ES6 section 20.3.4.32 Date.prototype.setUTCMinutes ( min, sec, ms )
578 CHECK_RECEIVER(JSDate, date, "Date.prototype.setUTCMinutes"); in BUILTIN()
583 double time_val = date->value().Number(); in BUILTIN()
606 return *JSDate::SetValue(date, DateCache::TimeClip(time_val)); in BUILTIN()
609 // ES6 section 20.3.4.31 Date.prototype.setUTCMonth ( month, date )
612 CHECK_RECEIVER(JSDate, this_date, "Date.prototype.setUTCMonth"); in BUILTIN()
627 Handle<Object> date = args.at(2); in BUILTIN() local
628 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, date, in BUILTIN()
629 Object::ToNumber(isolate, date)); in BUILTIN()
630 dt = date->Number(); in BUILTIN()
637 // ES6 section 20.3.4.34 Date.prototype.setUTCSeconds ( sec, ms )
640 CHECK_RECEIVER(JSDate, date, "Date.prototype.setUTCSeconds"); in BUILTIN()
645 double time_val = date->value().Number(); in BUILTIN()
662 return *JSDate::SetValue(date, DateCache::TimeClip(time_val)); in BUILTIN()
665 // ES6 section 20.3.4.35 Date.prototype.toDateString ( )
668 CHECK_RECEIVER(JSDate, date, "Date.prototype.toDateString"); in BUILTIN()
670 ToDateString(date->value().Number(), isolate->date_cache(), in BUILTIN()
676 // ES6 section 20.3.4.36 Date.prototype.toISOString ( )
679 CHECK_RECEIVER(JSDate, date, "Date.prototype.toISOString"); in BUILTIN()
680 double const time_val = date->value().Number(); in BUILTIN()
703 // ES6 section 20.3.4.41 Date.prototype.toString ( )
706 CHECK_RECEIVER(JSDate, date, "Date.prototype.toString"); in BUILTIN()
708 ToDateString(date->value().Number(), isolate->date_cache(), in BUILTIN()
714 // ES6 section 20.3.4.42 Date.prototype.toTimeString ( )
717 CHECK_RECEIVER(JSDate, date, "Date.prototype.toTimeString"); in BUILTIN()
719 ToDateString(date->value().Number(), isolate->date_cache(), in BUILTIN()
726 // ecma402 #sup-date.prototype.tolocaledatestring
732 const char* method_name = "Date.prototype.toLocaleDateString"; in BUILTIN()
733 CHECK_RECEIVER(JSDate, date, method_name); in BUILTIN()
738 date, // date in BUILTIN()
746 // ecma402 #sup-date.prototype.tolocalestring
752 const char* method_name = "Date.prototype.toLocaleString"; in BUILTIN()
753 CHECK_RECEIVER(JSDate, date, method_name); in BUILTIN()
758 date, // date in BUILTIN()
766 // ecma402 #sup-date.prototype.tolocaletimestring
772 const char* method_name = "Date.prototype.toLocaleTimeString"; in BUILTIN()
773 CHECK_RECEIVER(JSDate, date, method_name); in BUILTIN()
778 date, // date in BUILTIN()
787 // ES6 section 20.3.4.43 Date.prototype.toUTCString ( )
790 CHECK_RECEIVER(JSDate, date, "Date.prototype.toUTCString"); in BUILTIN()
792 ToDateString(date->value().Number(), isolate->date_cache(), in BUILTIN()
798 // ES6 section B.2.4.1 Date.prototype.getYear ( )
801 CHECK_RECEIVER(JSDate, date, "Date.prototype.getYear"); in BUILTIN()
802 double time_val = date->value().Number(); in BUILTIN()
803 if (std::isnan(time_val)) return date->value(); in BUILTIN()
812 // ES6 section B.2.4.2 Date.prototype.setYear ( year )
815 CHECK_RECEIVER(JSDate, date, "Date.prototype.setYear"); in BUILTIN()
827 if (!std::isnan(date->value().Number())) { in BUILTIN()
828 int64_t const time_ms = static_cast<int64_t>(date->value().Number()); in BUILTIN()
840 return SetLocalDateValue(isolate, date, time_val); in BUILTIN()
843 // ES6 section 20.3.4.37 Date.prototype.toJSON ( key )