Closed corocoto closed 3 years ago
I trying to deserialize string format of Date to Date object, but it's still string type.
I thought it was done automatically after reading the #4592 issue. Maybe I understood it somehow differently. And if it is, how can I make it right?
currentDate
static get properties(){ currentDate : { type : Date, value : '2020-08-04T15:08:58.037Z', // ISO format }, }
connectedCallback
connectedCallback(){ super.connectedCallback(); console.log(this.currentDate.constructor === Date); }
Should display true.
true
Display false.
false
Ah, sorry. It's my wrong. It will be work if I set string value ('2020-08-04T15:08:58.037Z') as attribute's value.
'2020-08-04T15:08:58.037Z'
So it looks like this:
<my-calendar current-date="2020-08-04T15:08:58.037Z"></my-calendar>
Description
I trying to deserialize string format of Date to Date object, but it's still string type.
I thought it was done automatically after reading the #4592 issue. Maybe I understood it somehow differently. And if it is, how can I make it right?
Steps to Reproduce
currentDate
like this:connectedCallback
:Expected Results
Should display
true
.Actual Results
Display
false
.Versions