-
Notifications
You must be signed in to change notification settings - Fork 9
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
Example for parseInstant #1
Comments
It is a bug, confirmed. I'm writing a test case and fixing it ASAP. Thanks for the report. |
Thank you! Looking forward using this feature :-) |
Well, not that easy. I've never used the parse tags nor on this library or the original joda counterpart. It took me a while to focus. When I forked the library I converted the original The base problem is a design one, IMHO. In your example you are trying to parse a date which should be parsed to a There are some StackOverflow questions relevant to this discussion:
If you look at I think the sensible approach is to split this tag into four. Yes, four tags.
Maybe even a fifth generic |
Hello,
I have some trouble getting the tag javatime:parseInstant running. Everything I tried results in
Caused by: java.time.format.DateTimeParseException: Text '2015-10-28' could not be parsed: Unable to obtain Instant from TemporalAccessor: {},ISO resolved to 2015-10-28 of type java.time.format.Parsed at java.time.format.DateTimeFormatter.createError(DateTimeFormatter.java:1920) ~[na:1.8.0_60] at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1855) ~[na:1.8.0_60] at net.sargue.time.jsptags.ParseInstantSupport.doEndTag(ParseInstantSupport.java:138) ~[java-time-jsptags-1.0.0.jar:1.0.0] at org.apache.jsp.WEB_002dINF.views.diary.overview_jsp._jspx_meth_jt_005fparseInstant_005f0(overview_jsp.java:207) ~[na:na] at org.apache.jsp.WEB_002dINF.views.diary.overview_jsp.access$1(overview_jsp.java:192) ~[na:na] at org.apache.jsp.WEB_002dINF.views.diary.overview_jsp$Helper.invoke2(overview_jsp.java:846) ~[na:na] at org.apache.jsp.WEB_002dINF.views.diary.overview_jsp$Helper.invoke(overview_jsp.java:1068) ~[na:na] at org.apache.jsp.tag.webtemplate_tag.doTag(webtemplate_tag.java:302) ~[na:na] at org.apache.jsp.WEB_002dINF.views.diary.overview_jsp._jspService(overview_jsp.java:153) ~[na:na] ... 60 common frames omitted
Caused by: java.time.DateTimeException: Unable to obtain Instant from TemporalAccessor: {},ISO resolved to 2015-10-28 of type java.time.format.Parsed at java.time.Instant.from(Instant.java:378) ~[na:1.8.0_60] at java.time.format.Parsed.query(Parsed.java:226) ~[na:1.8.0_60] at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851) ~[na:1.8.0_60] ... 67 common frames omitted
Caused by: java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: InstantSeconds at java.time.format.Parsed.getLong(Parsed.java:203) ~[na:1.8.0_60] at java.time.Instant.from(Instant.java:373) ~[na:1.8.0_60] ... 69 common frames omitted
. Could you maybe provide a running example e.g. for a String coded in ISO format?E.g.:
<javatime:parseInstant value="2015-10-28" pattern="yyyy-MM-dd" var="date" />
should store a LocaleDate in the variable date out of the provided string as far as I understand.The text was updated successfully, but these errors were encountered: