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)); |
} |