TheoG
TheoG

Reputation: 1558

Type '{ dateStyle: string; }' has no properties in common with type 'DateTimeFormatOptions'.ts(2559)

"typescript": "^4.0.3"

How do I resolve the above mentioned typescript error I'm receiving on the following code?:

components/OrderListItem.tsx

const newedate = (_date) => {
  const options = {dateStyle: 'medium'}; //{ weekday: 'long', hour: 'numeric'};
  const dateT = new Intl.DateTimeFormat('en-UK', options).format(_date);
  return dateT;
}

enter image description here

My partial repo is here: https://github.com/TheoMer/next_apollo

Upvotes: 1

Views: 887

Answers (1)

TheoG
TheoG

Reputation: 1558

I posted this issue with the typescript guys and it turns out that this is a bug: https://github.com/microsoft/TypeScript/issues/40806

Upvotes: 2

Related Questions