Skip to content

Allow a Locale to be set for formatting #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

mdeinum
Copy link
Collaborator

@mdeinum mdeinum commented Dec 6, 2022

The internal DataFormatter used from Apache POI allows for setting a fixed Locale to use when reading numbers, dates etc. Initially we didn't set this and thus it always used the default Locale as set from the Java runtime. This could lead to unexpected results. We now allow to set the userLocale property and use this to configure the DataFormatter used internally.

We also took the opportunity to make this work with the streaming ItemReader as well as the regular ItemReader. The streaming item reader now also uses a pre-configured DataFormatter.

Closes: #98

The internal DataFormatter used from Apache POI allows for setting a fixed
Locale to use when reading numbers, dates etc. Initially we didn't set this
and thus it always used the default Locale as set from the Java runtime. This
could lead to unexpected results. We now allow to set the userLocale property
and use this to configure the DataFormatter used internally.

We also took the opportunity to make this work with the streaming ItemReader
as well as the regular ItemReader. The streaming item reader now also uses
a pre-configured DataFormatter.

Closes: #98
@mdeinum mdeinum force-pushed the 98-when-extracting-data-from-the-rowset-rs-year-in-date-cell-is-shortened branch from a7f0990 to 77f441b Compare December 6, 2022 14:25
@mdeinum mdeinum merged commit f9709d9 into main Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When extracting data from the RowSet (rs) year in date cell is shortened
1 participant