cds2types icon indicating copy to clipboard operation
cds2types copied to clipboard

CDS type "Date" to TypeScript type "Date" conversion is incorrect

Open stockbal opened this issue 2 years ago • 1 comments

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

stockbal avatar Sep 23 '22 13:09 stockbal

Hi @stockbal,

We'll look into this one. Thanks for reporting.

Kind regards Johannes

thisisevanfox avatar Nov 09 '22 11:11 thisisevanfox