com.atlassian.jira.web.util
Class OutlookDate

java.lang.Object
  extended bycom.atlassian.jira.web.util.OutlookDate

public class OutlookDate
extends 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.


Field Summary
static long DAY
           
static long HOUR
           
static long MINUTE
           
static int OTHER
           
static long SECOND
           
static int THIS_WEEK
           
static int TODAY
           
static int YESTERDAY
           
 
Constructor Summary
OutlookDate(Locale locale)
           
 
Method Summary
 int daysAgo(Date date)
           
 int daysAgo(Date oldDate, 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).
 void flushCache()
           
 String format()
           
 String format(Date date)
           
 String format(Date date, Locale remoteUserLocale)
          Deprecated. Please use format(java.util.Date) instead.
 String formatDatePicker(Date date)
           
 String formatDateTimePicker(Date date)
           
 String formatDay(Date date)
           
 String formatDMY(Date date)
           
 String formatDMYHMS(Date date)
           
 String formatRss(Date date)
          Format a date for RSS feeds.
 String formatTime(Date date)
           
 DateFormat getCompleteDateFormat()
          This helper is here to assist with formatting emails etc, and should only be used by JIRAVelocityManager.
 String getCompleteDateTimeFormat()
           
 String getDatePickerFormat()
           
 String getDatePickerFormatSample(Date date)
           
 String getDateTimePickerFormat()
           
 String getDateTimePickerFormatSample(Date date)
           
 Locale getLocale()
           
 Date getNow()
           
 boolean isDatePickerDate(String value)
           
 Date parseCompleteDateTime(String value)
           
 Date parseDatePicker(String value)
           
 Date parseDateTimePicker(String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECOND

public static final long SECOND
See Also:
Constant Field Values

MINUTE

public static final long MINUTE
See Also:
Constant Field Values

HOUR

public static final long HOUR
See Also:
Constant Field Values

DAY

public 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
Constructor Detail

OutlookDate

public OutlookDate(Locale locale)
Method Detail

getLocale

public Locale getLocale()

flushCache

public void flushCache()

formatDMY

public String formatDMY(Date date)

formatDMYHMS

public String formatDMYHMS(Date date)

formatTime

public String formatTime(Date date)

formatDay

public String formatDay(Date date)

formatDatePicker

public String formatDatePicker(Date date)

formatDateTimePicker

public String formatDateTimePicker(Date date)

formatRss

public String formatRss(Date date)
Format a date for RSS feeds. Uses MailDateFormat to format the dates


format

public String format()

format

public String format(Date date)

format

public String format(Date date,
                     Locale remoteUserLocale)
Deprecated. Please use format(java.util.Date) instead.


getNow

public Date getNow()

daysAgo

public int daysAgo(Date date)

daysAgo

public int daysAgo(Date oldDate,
                   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 Date parseDatePicker(String value)
                     throws ParseException
Throws:
ParseException

parseCompleteDateTime

public Date parseCompleteDateTime(String value)
                           throws ParseException
Throws:
ParseException

parseDateTimePicker

public Date parseDateTimePicker(String value)
                         throws ParseException
Throws:
ParseException

getDatePickerFormat

public String getDatePickerFormat()

getDatePickerFormatSample

public String getDatePickerFormatSample(Date date)

getDateTimePickerFormatSample

public String getDateTimePickerFormatSample(Date date)

isDatePickerDate

public boolean isDatePickerDate(String value)

getDateTimePickerFormat

public String getDateTimePickerFormat()

getCompleteDateTimeFormat

public String getCompleteDateTimeFormat()

getCompleteDateFormat

public DateFormat getCompleteDateFormat()
This helper is here to assist with formatting emails etc, and should only be used by JIRAVelocityManager.

Returns:


Copyright © 2002-2006 Atlassian. All Rights Reserved.