Jump to content
We've recently updated our Privacy Statement, available here ×
  • How to determine the next Sunday from today in JasperReports?


    ghudson_1
    • Product: JasperReports® Library

    Issue Description

    Relative Dates feature in JasperReports Server is great for setting/getting date values relative to the current day, but they don't have a concept of the actual day of week. If you need to determine the next Sunday from today, for example, you can try using java.time.temporal.TemporalAdjuster in an expression.

     

    Resolution

     

    Try an expression with syntax similar to the following which instantiates a java.time.LocalDate object:

    LocalDate.parse($F{InputParam_Date}, DateTimeFormatter.ISO_OFFSET_DATE_TIME).with(TemporalAdjusters.nextOrSame(DayOfWeek.SUNDAY))

    https://docs.oracle.com/javase/8/docs/api/java/time/temporal/TemporalAdjuster.html

    https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html

    Ref. Case 01864122


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...