-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(util.convert): epoch times stored as strings convert correctly, u…
…nit test fixup, parse iso dates in local tz (#699) * fix: parse string dates directly with moment * fix: error for convert unknown to moment more specific Previously stated "Unable to convert to Date" Now states "Unable to convert to moment" * test: add html doc for testing offset behaviour * test: test string to date conversions more rigorously * refactor(utils.convert): remove repeated code, throw TypeErrors Previously, "Date" & "Moment" had identical switch branches, but each return statement in "Date" had `moment(...).toDate()`. Now, Date branch is just `convert(object, "Moment").toDate()`. Also, each now throw TypeErrors, & Date branch catches "TypeError" & rethrows its own. * test(util.convert): test for "TypeError" when testing throws * test(util.convert): more robust output checking for date conversion * fix(util.convert): convert epoch times in strings to number before converting to moment * test(util.convert): improve "testOffset" example * Delete testOffset.html as per review comment Co-authored-by: Yotam Berkowitz <[email protected]>
- Loading branch information
Showing
2 changed files
with
48 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters