Tag Info

Hot answers tagged

5

Since the .getTime() value is already in UTC, you can just divide by 1000, and round. That is: var apiDate = Math.round (new Date().getTime() / 1000); works just fine. apiDate is in "unix epoch time" and the API takes these values even if the API parameter is called a "Date". But, if you want to truncate to the date only, just use: var dateTime = ...


1

Alrighty - I found the issue. Tampermonkey assumes that any exception thrown from a user script is an Error object (well...it assumes the exception data will have at least the message and stack properties). When it tries to do string operations on undefined properties, it throws its own exception which makes the whole thing blow up. The Javascript SDK ...



Only top voted, non community-wiki answers of a minimum length are eligible