summaryrefslogtreecommitdiffstats
path: root/src/date.js
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-08-19 15:07:18 +0100
committerIain Merrick <husky@google.com>2010-08-23 14:25:34 +0100
commit756813857a4c2a4d8ad2e805969d5768d3cf43a0 (patch)
tree002fad3c25654870c9634232d53a48219346c50b /src/date.js
parentbb769b257e753aafcbd96767abb2abc645eaa20c (diff)
downloadandroid_external_v8-756813857a4c2a4d8ad2e805969d5768d3cf43a0.tar.gz
android_external_v8-756813857a4c2a4d8ad2e805969d5768d3cf43a0.tar.bz2
android_external_v8-756813857a4c2a4d8ad2e805969d5768d3cf43a0.zip
Update V8 to r5295 as required by WebKit r65615
Change-Id: I1d72d4990703e88b7798919c7a53e12ebf76958a
Diffstat (limited to 'src/date.js')
-rw-r--r--src/date.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/date.js b/src/date.js
index 9c42a04f..b101ea66 100644
--- a/src/date.js
+++ b/src/date.js
@@ -137,12 +137,18 @@ var DST_offset_cache = {
// Time interval where the cached offset is valid.
start: 0, end: -1,
// Size of next interval expansion.
- increment: 0
+ increment: 0,
+ initial_increment: 19 * msPerDay
};
// NOTE: The implementation relies on the fact that no time zones have
-// more than one daylight savings offset change per month.
+// more than one daylight savings offset change per 19 days.
+//
+// In Egypt in 2010 they decided to suspend DST during Ramadan. This
+// led to a short interval where DST is in effect from September 10 to
+// September 30.
+//
// If this function is called with NaN it returns NaN.
function DaylightSavingsOffset(t) {
// Load the cache object from the builtins object.
@@ -171,7 +177,7 @@ function DaylightSavingsOffset(t) {
// the offset in the cache, we grow the cached time interval
// and return the offset.
cache.end = new_end;
- cache.increment = msPerMonth;
+ cache.increment = cache.initial_increment;
return end_offset;
} else {
var offset = %DateDaylightSavingsOffset(EquivalentTime(t));
@@ -182,7 +188,7 @@ function DaylightSavingsOffset(t) {
// the interval to reflect this and reset the increment.
cache.start = t;
cache.end = new_end;
- cache.increment = msPerMonth;
+ cache.increment = cache.initial_increment;
} else {
// The interval contains a DST offset change and the given time is
// before it. Adjust the increment to avoid a linear search for
@@ -207,7 +213,7 @@ function DaylightSavingsOffset(t) {
var offset = %DateDaylightSavingsOffset(EquivalentTime(t));
cache.offset = offset;
cache.start = cache.end = t;
- cache.increment = msPerMonth;
+ cache.increment = cache.initial_increment;
return offset;
}