Issue Overview
Unexpected error on tsc compile.
Steps to Reproduce
error TS2353: Object literal may only specify known properties, and dateStyle does not
exist in type DateTimeFormatOptions
Issue source file: utils.js
function formatDate(date) {
return date.toLocaleDateString("en-US", {
dateStyle: "medium"
});
}
Cause & Solution
Caused by using (tsconfig.js) "target": "ES6" for 01_Challange as per solution file.
dateStyle attribute of common type DateTimeFormatOptions was not added to spec until ES2020
dateStyle Spec Proposal July 2020 Stage 3
Issue Overview
Unexpected error on tsc compile.
Steps to Reproduce
error TS2353: Object literal may only specify known properties, and dateStyle does not
exist in type DateTimeFormatOptions
Issue source file: utils.js
Cause & Solution
Caused by using (tsconfig.js) "target": "ES6" for 01_Challange as per solution file.
dateStyle attribute of common type DateTimeFormatOptions was not added to spec until ES2020
dateStyle Spec Proposal July 2020 Stage 3