I have sucessfully added joda to my classpath and I can display org.joda.time.LocalDate in my report.
I can not seem to figure out how to apply a formatter. I know that the joda formatter looks different than the java flavor.
what is the secret to formatting joda dates whilst in ireport?
Ted
2 Answers:
I found an answer.
Originally I had a field that was a localdate. $F{materialsClose}. I was defining its properties/field class to be: org.joda.time.LocalDate
Instead, I set the field class to java.lang.String
then the "text field expression" for the textField is: new org.joda.time.LocalDate($F{materialsClose}).toDate()
set the pattern to the format and voila, a properly formatted LocalDate.
I was hoping that if the joda .jar was in the classpath, then the datetimeformat would be available.
but no! materialsClose is a joda LocalDate. so its Field Class is org.joda.time.LocalDate.
I tried this as an attempt to have a formatted date, but
(new DateTimeFormat.forPattern("MMMM, yyyy").print($F{materialsClose}))
but the compile error I get is:
DateTimeFormat.forPattern cannot be resolved to a type.
I am importing org.joda.time.DateTime. is there something more I have to import?
When you checked a post to show it's been resolved, nobody else can't post an answer.