How I can get date string, when date ago is mayor to n days?

Splash Forums PrettyTime Users How I can get date string, when date ago is mayor to n days?

This topic contains 1 reply, has 2 voices, and was last updated by  Lincoln Baxter III 6 years, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #17971

    jlgranda
    Participant

    How I can get date string, when date ago is mayor to n days.

    I neew print 25 Jun, if the diference between today and then is mayor than 1 day. I won’t print 4 days ago

    Please an advance?

    #21082

    You could use prettyTime.calculatePreciseDuration(final Date then), which returns a list of Duration objects – all duration objects, not just the most “relevant” duration. Then format the duration you like (choose days in this case) using prettyTime.format(Duration duration)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Comments are closed.