The method toLocalDate() is easy to misunderstand - it could mean something related to the user's local timezone. I've actually made this false assumption a couple of times when reviewing PRs in our own codebase.
It would be more intuitive if it was called toNativeDate(). Tellingly, this is how the comment in the types file already describes it:
/** @returns the native Date object at the same epoch */
toLocalDate(): Date
Can I suggest that we rename the method, but leave toLocalDate() as a deprecated alias?
The method
toLocalDate()
is easy to misunderstand - it could mean something related to the user's local timezone. I've actually made this false assumption a couple of times when reviewing PRs in our own codebase.It would be more intuitive if it was called
toNativeDate()
. Tellingly, this is how the comment in the types file already describes it:Can I suggest that we rename the method, but leave
toLocalDate()
as a deprecated alias?