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

Unified Diff: src/date-delay.js

Issue 8875: Fix Chromium issue 3607.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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 | « no previous file | no next file » | 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 631)
+++ src/date-delay.js (working copy)
@@ -502,7 +502,6 @@
var WeekDays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
var Months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
iposva 2008/10/29 22:59:38 missing new line?
-
function TwoDigitString(value) {
return value < 10 ? "0" + value : "" + value;
}
@@ -517,6 +516,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 +628,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 | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698