cds2types
cds2types copied to clipboard
CDS type "Date" to TypeScript type "Date" conversion is incorrect
Hi,
first of all, great job in providing this tool 😎.
However, I discovered that you cannot really use Date
objects at Date
elements of a CDS entity.
The framework will return strings like 2022-09-01
for such elements, and if you pass a Date
object during an INSERT.into
call nothing will be written in the database
We are using these npm versions:
- @sap/cds: 5.9.8
- @sap/cds-compiler: 2.15.4
- @sap/cds-dk: 6.0.3
- @sap/eslint-plugin-cds: 2.4.1
Right now we are just rewriting such Date
properties in the generated type files back to string
as a workaround.
Regards, Ludwig
Hi @stockbal,
We'll look into this one. Thanks for reporting.
Kind regards Johannes