45
rated 0 times
[
51]
[
6]
/ answers: 1 / hits: 5921
/ 4 Years ago, tue, december 31, 2019, 12:00:00
I'm trying to update dates in my angular 6 application using Intl.DateTimeFormat and passing locale and dateStyle, timeStyle options. I'm able to get the custom date while trying in browser console however as soon as I try to integrate the same in my app, it throws compilation error: Type '{ dateStyle: string; timeStyle: string; }' has no properties in common with type 'DateTimeFormatOptions'.
transformDate() {
const options = { dateStyle: full, timeStyle: medium };
console.log(new Intl.DateTimeFormat('en-US',options).format(this.date));
}
More From » html