You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It may be working as documented, but it is not working as expected. In particular, I tend to think of a POSIXt object in the same way whether it is a POSIXlt or POSIXct object. The fact that the current unbox works differently for the two is unexpected, and forces the developer to think about the underlying representation of the object.
Also, normally both POSIXct and POSIXlt objects are translated into the same format depending on the POSIXt argument to toJSON. So treating the POSIXct object differently in unbox is a bit unexpected.
FInally, it is literally a 3-line patch; I've already submitted the pull request.
Here is a quick sample which shows the bug:
POSIXlt works as expected:
However, POSIXct fails
I can work around by calling
jsonlite:::as.scalar
on the internal object, but I'm then depending on undocumented internals.This issue may be at the heart of #192 and #194.
The text was updated successfully, but these errors were encountered: