'Why can't Date accept a string as input in Typescript?
In my typescript compilation, this line is getting an error: const fakeDate = new Date("2018-07-18T13:28:59Z")
The error is ERROR TS2322: Type '~lib/string/String' is not assignable to type 'i64'..
My tsconfig.json is:
{
"compilerOptions": {
"target": "es2018",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"outDir": "dist",
"noImplicitAny": false
},
"include": ["./scripts", "./test"],
"noImplicitAny": false,
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
Any idea what's up? I suspect it's some typescript config, but unsure what.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
