TimeShift-js icon indicating copy to clipboard operation
TimeShift-js copied to clipboard

toLocaleDateString doesn't work in V8 when we override Date

Open pwmarcz opened this issue 12 years ago • 1 comments

> Date = TimeShift.Date
> new TimeShift.Date().toLocaleDateString()
TypeError: Method invoked on an object that is not Date.
> new TimeShift.OriginalDate().toLocaleDateString()
TypeError: Method invoked on an object that is not Date.

It looks like V8 code checks if date instanceof Date (see overrides.js) which fails when Date has been changed.

pwmarcz avatar Aug 28 '13 08:08 pwmarcz

That's strange - the code always invokes the original toLocaleDateString method on the original Date object. When I run those commands in Chromium version 28, they work (though may produce the wrong string, as stated in the known issues). What are you running those commands on?

plaa avatar Oct 11 '13 15:10 plaa