mde / timezone-js

DEPRECATED: Timezone-enabled JavaScript Date object. Uses Olson zoneinfo files for timezone data.
824 stars 183 forks source link

TimezoneJS should be a little bit more robust when test frameworks wrap the Date constructor. #80

Closed elarkin closed 11 years ago

elarkin commented 11 years ago

No longer failing to detect dates when test frameworks overwrite the Date constructor (poorly)

Specifically, SinonJS overwrites the Date constructor with a function that produces date objects whose constructor property is the original Date constructor, while Date currently refers to the Sinon wrapper.

That hullabaloo makes a.constructor !== Date end up true when it should be false.