Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: src/date-delay.js

Issue 8733: Merged bleeding_edge r599:645 into regexp2000. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/regexp2000/
Patch Set: Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler.cc ('k') | src/execution.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/date-delay.js
===================================================================
--- src/date-delay.js (revision 645)
+++ src/date-delay.js (working copy)
@@ -517,6 +517,19 @@
}
+var LongWeekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
+var LongMonths = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
+
+
+function LongDateString(time) {
+ var YMD = FromJulianDay(Day(time) + kDayZeroInJulianDay);
+ return LongWeekDays[WeekDay(time)] + ', '
+ + LongMonths[YMD.month] + ' '
+ + TwoDigitString(YMD.date) + ', '
+ + YMD.year;
+}
+
+
function TimeString(time) {
return TwoDigitString(HourFromTime(time)) + ':'
+ TwoDigitString(MinFromTime(time)) + ':'
@@ -616,7 +629,9 @@
// ECMA 262 - 15.9.5.6
function DateToLocaleDateString() {
- return DateToDateString.call(this);
+ var t = GetTimeFrom(this);
+ if ($isNaN(t)) return kInvalidDate;
+ return LongDateString(LocalTimeNoCheck(t));
}
« no previous file with comments | « src/compiler.cc ('k') | src/execution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698