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

"ConversionException: Invalid format for date" in a query that takes date parameters #99

Closed
abstratt opened this issue Feb 11, 2016 · 4 comments

Comments

@abstratt
Copy link
Owner

resource.expenses.ConversionException: Invalid format for date in 'start': 2016/02/01
    at resource.expenses.ExpenseResource.executeFindExpensesInPeriod(ExpenseResource.java:276)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
@abstratt
Copy link
Owner Author

The expected format is: yyyy-MM-dd'T'HH:mm'Z'. Maybe there should be a date and a datetime types. Or support for an alternative date-only format. Or we could just fix kirra-angular to send the date in the expected format.

@abstratt
Copy link
Owner Author

Also: resource.expenses.ConversionException: Invalid format for date in 'date': 2016-02-13T02:00:00.000Z

@abstratt
Copy link
Owner Author

Fixing so it too will accept yyy/MM/dd but that is really a bug in abstratt/kirra-ui#16.

Once we stop covering for kirra-angular, we could switch to using the new DateFormatter, which supports optional parts:

DateTimeFormatter formatter = new DateTimeFormatterBuilder().parseLenient().appendPattern(
    "yyyy-MM-dd['T'HH:mm[:ss[.SSS]]'Z']"
).toFormatter();

@abstratt
Copy link
Owner Author

Fixed.

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

No branches or pull requests

1 participant