public class FriendlyDateFormatter extends Object
DateFormatter
is used to
format some dates according to the server's formats and the user's time zone. As such, you will need a new
instance of this class for each user and "current time", typically one per request.
It is recommended that you pass a "now" time to the constructor to ensure that times are formatted against a known standard point in time. The alternate constructor uses the time that this object is created, which is probably not very useful.
This class is not thread-safe, primarily because it uses a DateFormatter class which is not thread-safe.
Constructor and Description |
---|
FriendlyDateFormatter(Date now,
DateFormatter dateFormatter) |
FriendlyDateFormatter(DateFormatter dateFormatter) |
Modifier and Type | Method and Description |
---|---|
Message |
getFormatMessage(Date date)
Returns the i18n message to format the given date relative to the "now" time passed to the constructor.
|
public FriendlyDateFormatter(DateFormatter dateFormatter)
public FriendlyDateFormatter(Date now, DateFormatter dateFormatter)
Copyright © 2003–2016 Atlassian. All rights reserved.