spreadsheetimporter / ui5-cc-spreadsheetimporter

A UI5 Component to integrate a Spreadsheet Upload for UI5 Apps.
https://spreadsheet-importer.com/
Apache License 2.0
78 stars 15 forks source link

[BUG] DateTimeOffset handling with and without precision #600

Closed marianfoo closed 1 month ago

marianfoo commented 1 month ago

In SAP CAP >=8 is a new validation implemented that checks DateTime Format, see https://cap.cloud.sap/docs/releases/jun24#new-input-validation

The Edm Type DateTimeOffset can be implemented with and without precision

<Property Name="validFrom" Type="Edm.DateTimeOffset"/>
<Property Name="timestamp" Type="Edm.DateTimeOffset" Precision="7"/>

Depending on the precision, the value needs to be formatted differently. With precision: 2023-11-25T00:00:00.000Z Without precision: 2023-11-25T00:00:00Z

With precision is for CDS Type Timestamp and without for DateTime. Timestamp is with precision and DateTime without The current Spreadsheet Importer Parser does not differentiale between those types.

TODO: Differentiate between Precision available and not available. Check if this property is already available in the parser and if not how to make it available. May check if precision is also important for numbers. Currently precision is not used (more)

https://github.com/spreadsheetimporter/ui5-cc-spreadsheetimporter/blob/0a9b015d67261884a018f71d06776c4567f8dbe5/packages/ui5-cc-spreadsheetimporter/src/controller/Parser.ts#L48-L63