Hello, I use Aspose Words for Java with LINQ reporting engine version 24.8 and have trouble with date time parsing when using setExactDateTimeParseFormats, seems like the time part is ignored and every date parsed with 00:00 time. I’m using JsonDataSource and setting options as described below. Also attaching sample json data and docx template.
public JsonDataLoadOptions jsonDataLoadOptions() {
var options = new JsonDataLoadOptions();
options.setExactDateTimeParseFormats(List.of("yyyy-MM-dd", "yyyy-MM-dd'T'HH:mm:ss.SSSXXX", "yyyy-MM-dd'T'HH:mm:ssXXX"));
return options;
}
However, even if these formats are applied, the issue still remains. For the sake of correction, we have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): WORDSJAVA-2976
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Thanks @ivan.lyagin
We observed that when we don not pass JsonDataLoadOptions at all dates seem to be parsed correctly along with time. We pass strings like 1/1 that are also parsed as Date, which we don’t want, thats why we tried to narrow the list of formats. Can you suggest a workaround for that issue while the fix is being developed? We are also facing another issue with Locale, seems like CurrentThreadSettings.setLocale(Locale.forLanguageTag("en_US")); is being ignored and the Locale from the machine running the reporting engine is used instead, any thoughts on that?
If switching to “en-US” instead of “en_US” does not solve the issue, please share your sample template, data, and code reproducing the issue for further analysis on our end.
@smialekp yes, the issue is already resolve in the current codebase. The fix will be included into the next 24.10 version of Aspose.Words. We will be sure to let you know once it is released.