Hopefully this is a common issue that someone can ...
# javascript
p
Hopefully this is a common issue that someone can help me with ? I've got a data class that has a kotlin,js.Date on it. If I print out the value of it via console.log I get: 2019-12-29T133000.000+0000 I'm trying to get the hours portion so I do
Copy code
date.getHours()
and I'm getting "TypeError: date.getHours is not a function" as an error in the browser. I don't quite understand this; does my date object not contain a date or something ?
i
@Paul N Hi! I failed to reproduce the problem. Can you attach your code?
p
I'll try and produce a standalone example. It's part of a bigger React project at the moment.
ah, it appears I did an unsafe cast when deserializing my JSON object to a js date, so what I thought was a date ended up being a string....