com.atlassian.jira.web.util
Class OutlookDate
java.lang.Object
com.atlassian.jira.web.util.OutlookDate
- public class OutlookDate
- extends java.lang.Object
Class to give a nice String representation of a date (inspired by Outlook)
Note: This class is not Threadsafe due to its use of DateFormat objects. Do not cache this
object across Threads.
Constructor Summary |
OutlookDate(java.util.Locale locale)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SECOND
static final long SECOND
- See Also:
- Constant Field Values
MINUTE
static final long MINUTE
- See Also:
- Constant Field Values
HOUR
static final long HOUR
- See Also:
- Constant Field Values
DAY
static final long DAY
- See Also:
- Constant Field Values
TODAY
public static final int TODAY
- See Also:
- Constant Field Values
YESTERDAY
public static final int YESTERDAY
- See Also:
- Constant Field Values
THIS_WEEK
public static final int THIS_WEEK
- See Also:
- Constant Field Values
OTHER
public static final int OTHER
- See Also:
- Constant Field Values
OutlookDate
public OutlookDate(java.util.Locale locale)
getLocale
public java.util.Locale getLocale()
flushCache
public void flushCache()
formatDMY
public java.lang.String formatDMY(java.util.Date date)
formatDMYHMS
public java.lang.String formatDMYHMS(java.util.Date date)
formatTime
public java.lang.String formatTime(java.util.Date date)
formatDay
public java.lang.String formatDay(java.util.Date date)
formatDatePicker
public java.lang.String formatDatePicker(java.util.Date date)
formatRss
public java.lang.String formatRss(java.util.Date date)
- Format a date for RSS feeds. Uses
MailDateFormat
to format the dates
format
public java.lang.String format()
format
public java.lang.String format(java.util.Date date)
format
public java.lang.String format(java.util.Date date,
java.util.Locale remoteUserLocale)
- Deprecated. Please use
format(java.util.Date)
instead.
getNow
public java.util.Date getNow()
daysAgo
public int daysAgo(java.util.Date date)
daysAgo
public int daysAgo(java.util.Date oldDate,
java.util.Date newDate)
- The method determines whether the date lies between now and previous midnight (
TODAY
), between now and
the midnight before previous (YESTERDAY
), or between now and 7 midnghts ago (THIS_WEEK
). If the
passed in date does not fall in any of the mentioned ranges, the method returns OTHER
.
parseDatePicker
public java.util.Date parseDatePicker(java.lang.String value)
throws java.text.ParseException
- Throws:
java.text.ParseException
parseCompleteDateTime
public java.util.Date parseCompleteDateTime(java.lang.String value)
throws java.text.ParseException
- Throws:
java.text.ParseException
getDatePickerFormat
public java.lang.String getDatePickerFormat()
isDatePickerDate
public boolean isDatePickerDate(java.lang.String value)
getCompleteDateTimeFormat
public java.lang.String getCompleteDateTimeFormat()
Copyright © 2002-2005 Atlassian. All Rights Reserved.