Skip to content
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

Allow the possibility to configure the hard-coded date format used in ExcelImportService when string-type date is detected #7

Open
sct999 opened this issue Nov 4, 2016 · 2 comments

Comments

@sct999
Copy link

sct999 commented Nov 4, 2016

Hi, it would be nice to allow the configuration of the date format used in ExcelImportService.

Just today I ran into an issue with this :)
In my app, dates are meant to be in dd/MM/yyyy format, and some user entered them as text...

@Michael-Habbert-mpf
Copy link

We had the same problem.
A few days ago we extended the property-map like:

static Map propertyConfigurationMap = [
releaseDate : ([expectedType: ExpectedPropertyType.DateJavaType, dateFormat: "dd.MM.yyyy", defaultValue: null]),
]
and added the dateFormat handling to the ExcelImportService like:

String dateFormat = DEFAULT_DATE_FORMAT
if (propertyConfiguration.dateFormat) {
dateFormat = propertyConfiguration.dateFormat
}
def df = new java.text.SimpleDateFormat(dateFormat)

May be I can provide a pull request for that.

@sct999
Copy link
Author

sct999 commented Nov 7, 2016

Hi @Micbert thank you a lot for your answer, we already had overriden some methods in the excel import service, for now I changed the default date format (as a temporary solution).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants