Automatic json date transformation
Posted: Thu Dec 17, 2020 7:38 am
Hello.
Is it possible to turn of the automatic handling of dates in DataSet.readJson? Currently I want to read in dates in ISO 8601 and just let it be when reading them and later transform it inside stimulsoft, as this seems more reliable. Using datetime in the datasource-list inside stimulsoft is not an option as it seems to then have trouble with a list of dates where the first date is null. The template also needs to be compatible with the .NET version.
The way it creates problems atm is that instead of giving the report a date on the yyyy-MM-ddThh-mm-ssZ format like the data is saved as, it gives the report dd-MM-yyyy hh-mm-ss (local date format), but if I then try to use the date-formating options inside stimulsoft, it will flip the day and month when rendering if they are ambiguous e.g. 11.12.20 will be rendered as 12.11.20. This problem of flipped dates is also not present in Firefox, only in Chrome/Chromium-based browsers.
In the .NET version I could turn of date handling for the serializer (Newtonsoft) and handling the dates as just strings worked well, but I can't seem to find how/if it's possible with the readJson method for the JS reports.
Is it possible to turn of the automatic handling of dates in DataSet.readJson? Currently I want to read in dates in ISO 8601 and just let it be when reading them and later transform it inside stimulsoft, as this seems more reliable. Using datetime in the datasource-list inside stimulsoft is not an option as it seems to then have trouble with a list of dates where the first date is null. The template also needs to be compatible with the .NET version.
The way it creates problems atm is that instead of giving the report a date on the yyyy-MM-ddThh-mm-ssZ format like the data is saved as, it gives the report dd-MM-yyyy hh-mm-ss (local date format), but if I then try to use the date-formating options inside stimulsoft, it will flip the day and month when rendering if they are ambiguous e.g. 11.12.20 will be rendered as 12.11.20. This problem of flipped dates is also not present in Firefox, only in Chrome/Chromium-based browsers.
In the .NET version I could turn of date handling for the serializer (Newtonsoft) and handling the dates as just strings worked well, but I can't seem to find how/if it's possible with the readJson method for the JS reports.