removing the 'ago' portion?

Splash Forums PrettyTime Users removing the 'ago' portion?

This topic contains 2 replies, has 2 voices, and was last updated by  mjpowersjr 11 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #17817


    I would like to use pretty time to display a friendly version of the overall duration of past events, without relevance to the current date / time. For Example:

    Task Duration

    Laundry 2 hours

    Where 2 hours is the delta between two dates I have recorded. In this case *how long ago* doesn’t really matter, only *how long* is the delta between two dates. I hope this makes sense. Does prettytime already support this?

    -Thanks in advance


    Yes, you need to replace the default message bundle and provide your own on the classpath:

    Specifically replace this class:

    Or simply create a new locale that is specific for your use-case:


    Then set the locale in PrettyTime to:

    PrettyTime p = new PrettyTime(new Locale("CUSTOM"));



    Worked perfect. Thanks!

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

The forum ‘PrettyTime Users’ is closed to new topics and replies.

Comments are closed.