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
{{ message }}
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
when i try to camelize my object, i want to convert one of the field (string) into moment object, like this
const p = camelizeKeys({
...myobject,
timestamp: moment(purchase.timestamp),
});
the camelization is ok, no error.
the thing is, moment object suppose to have .format function defined on the object.
but when i try to access it from p.timestamp.format it said that format is undefined.
what is the cause of that? how to do it 'properly' ?
The text was updated successfully, but these errors were encountered:
for now, i do have workaround for that,
i separate the camelization with the string-to-moment conversion, like this
const p = camelizeKeys({
...myObject,
})
p.timestamp = moment(p.timestamp);
with that, i can access the p.format().
pirey
changed the title
invalid moment object when converting string to Moment inside camelizeKeys
invalid moment object when converting string to moment inside camelizeKeys
Oct 22, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
when i try to camelize my object, i want to convert one of the field (string) into moment object, like this
the camelization is ok, no error.
the thing is, moment object suppose to have
.format
function defined on the object.but when i try to access it from
p.timestamp.format
it said thatformat
is undefined.what is the cause of that? how to do it 'properly' ?
The text was updated successfully, but these errors were encountered: