Hey Daniel, thx for the pull request.

It looks good now, though I think this whole condition could be replaced with 

        if (!(date instanceof Date)) {
            return null;
        }

to save some time for the checks, and a few bytes too (this also works for date being `null`, `undefined` etc.).