|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.web.util.OutlookDate
public class OutlookDate
Formats and parses dates in a variety of formats, including relative dates such as "Today" and "Last Wednesday".
DateTimeFormatterFactory
Nested Class Summary | |
---|---|
static class |
OutlookDate.SmartFormatterModes
Modes used by formatSmart(java.util.Date, com.atlassian.jira.web.util.OutlookDate.SmartFormatterModes) |
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)
Deprecated. Use OutlookDate(java.util.Locale, com.atlassian.jira.config.properties.ApplicationProperties, com.atlassian.jira.util.I18nHelper.BeanFactory, com.atlassian.jira.datetime.DateTimeFormatterFactory) or better still OutlookDateManager . Since v4.3 |
|
OutlookDate(Locale locale,
ApplicationProperties applicationProperties)
Deprecated. Use OutlookDate(java.util.Locale, com.atlassian.jira.config.properties.ApplicationProperties, com.atlassian.jira.util.I18nHelper.BeanFactory, com.atlassian.jira.datetime.DateTimeFormatterFactory) or better still OutlookDateManager . Since v4.3 |
|
OutlookDate(Locale locale,
ApplicationProperties applicationProperties,
I18nHelper.BeanFactory i18nHelperFactory,
DateTimeFormatterFactory dateTimeFormatterFactory)
|
Method Summary | |
---|---|
int |
daysAgo(Date date)
Deprecated. Use Days.daysBetween(org.joda.time.ReadablePartial, org.joda.time.ReadablePartial) instead. Since v4.4. |
int |
daysAgo(Date theDate,
Date theReferenceDate)
Deprecated. Use Days.daysBetween(org.joda.time.ReadablePartial, org.joda.time.ReadablePartial) instead. Since v4.4. |
String |
format()
Deprecated. Use DateTimeFormatter.format(java.util.Date) instead. Since v4.4. |
String |
format(Date date)
Deprecated. Use DateTimeFormatter.format(java.util.Date) instead. Since
v4.4. |
String |
formatDatePicker(Date date)
Deprecated. Use DateTimeFormatter.format(java.util.Date) instead. Since
v4.4. |
String |
formatDateTimePicker(Date date)
Deprecated. Use DateTimeFormatter.format(java.util.Date) instead. Since
v4.4. |
String |
formatDay(Date date)
Deprecated. Use DateTimeFormatter.format(java.util.Date) instead. Since
v4.4. |
String |
formatDMY(Date date)
Deprecated. Use DateTimeFormatter.format(java.util.Date) instead. Since
v4.4. |
String |
formatDMYHMS(Date date)
Returns the given date formatted as a String in the current user's time zone if possible, in the format specified by DateTimeStyle.COMPLETE . |
String |
formatIso8601(Date date)
Formats the given date into ISO8601 format. |
String |
formatIso8601Date(Date date)
Formats the given date into ISO8601 format. |
String |
formatRss(Date date)
Format a date for RSS feeds. |
String |
formatRssRfc822(Date date)
Deprecated. Use DateTimeFormatter.format(java.util.Date) instead. Since v4.4. |
String |
formatSmart(Date date,
OutlookDate.SmartFormatterModes mode)
Format the date "smartly", by using the day of the week if the date falls within a week in either direction of the current date. |
String |
formatTime(Date date)
Returns the given date formatted as a String in the current user's time zone if possible, in the format specified by DateTimeStyle.TIME . |
DateFormat |
getCompleteDateFormat()
Deprecated. Use DateTimeFormatter.getFormatHint() instead. Since v4.4. |
String |
getCompleteDateTimeFormat()
Deprecated. Use DateTimeFormatter.getFormatHint() instead. Since v4.4. |
String |
getDatePickerFormat()
Deprecated. Use DateTimeFormatter.getFormatHint() instead. Since v4.4. |
String |
getDatePickerFormatSample(Date date)
Deprecated. Use DateTimeFormatter.format(java.util.Date) instead. Since
v4.4. |
String |
getDateTimePickerFormat()
Deprecated. Use DateTimeFormatter.getFormatHint() instead. Since v4.4. |
String |
getDateTimePickerFormatSample(Date date)
Deprecated. Use DateTimeFormatter.format(java.util.Date) instead. Since
v4.4. |
Locale |
getLocale()
|
Date |
getNow()
Deprecated. Use Date.Date() instead. Since v4.4. |
boolean |
isDatePickerDate(String value)
|
Date |
parseCompleteDateTime(String value)
Deprecated. Use DateTimeFormatter.parse(String) instead. Since v4.4. |
Date |
parseDatePicker(String value)
Deprecated. Use DateTimeFormatter.parse(String) instead. Since v4.4. |
Date |
parseDateTimePicker(String value)
Deprecated. Use DateTimeFormatter.parse(String) instead. Since v4.4. |
static Date |
parseRss(String rssDate)
Deprecated. Use DateTimeFormatter.format(java.util.Date) instead. Since v4.4. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long SECOND
public static final long MINUTE
public static final long HOUR
public static final long DAY
public static final int TODAY
public static final int YESTERDAY
public static final int THIS_WEEK
public static final int OTHER
Constructor Detail |
---|
public OutlookDate(Locale locale, ApplicationProperties applicationProperties, I18nHelper.BeanFactory i18nHelperFactory, DateTimeFormatterFactory dateTimeFormatterFactory)
public OutlookDate(Locale locale)
OutlookDate(java.util.Locale, com.atlassian.jira.config.properties.ApplicationProperties, com.atlassian.jira.util.I18nHelper.BeanFactory, com.atlassian.jira.datetime.DateTimeFormatterFactory)
or better still OutlookDateManager
. Since v4.3
locale
- public OutlookDate(Locale locale, ApplicationProperties applicationProperties)
OutlookDate(java.util.Locale, com.atlassian.jira.config.properties.ApplicationProperties, com.atlassian.jira.util.I18nHelper.BeanFactory, com.atlassian.jira.datetime.DateTimeFormatterFactory)
or better still OutlookDateManager
. Since v4.3
locale
- applicationProperties
- Method Detail |
---|
public Locale getLocale()
public String formatIso8601(Date date)
formatIso8601Date(java.util.Date)
method instead.
date
- date to format
public String formatIso8601Date(Date date)
formatIso8601(java.util.Date)
method instead.
date
- date to format
@Deprecated public String formatDMY(Date date)
DateTimeFormatter.format(java.util.Date)
instead. Since
v4.4.
DateTimeStyle.DATE
.
date
- a Date
public String formatDMYHMS(Date date)
DateTimeStyle.COMPLETE
.
date
- a Date
public String formatTime(Date date)
DateTimeStyle.TIME
.
date
- a Date
@Deprecated public String formatDay(Date date)
DateTimeFormatter.format(java.util.Date)
instead. Since
v4.4.
@Deprecated public String formatDatePicker(Date date)
DateTimeFormatter.format(java.util.Date)
instead. Since
v4.4.
DateTimeStyle.DATE_PICKER
.
@Deprecated public String formatDateTimePicker(Date date)
DateTimeFormatter.format(java.util.Date)
instead. Since
v4.4.
DateTimeStyle.DATE_TIME_PICKER
.
public String formatRss(Date date)
MailDateFormat
to format the given date. Returns an empty string if
null is passed in.
date
- date to format
public String formatRssRfc822(Date date)
DateTimeFormatter.format(java.util.Date)
instead. Since v4.4.
MailDateFormat
which is technically incorrect. MailDateFormat
will however parse this format.
See http://cyber.law.harvard.edu/rss/rss.html
See http://asg.web.cmu.edu/rfc/rfc822.html#sec-5.1
Correct : Wed, 22 Aug 2007 10:00:10 +1000
Incorrect : Wed, 22 Aug 2007 10:00:10 +1000 (GMT+10:00)
date
- the date to format into a string
format(java.util.Date)
public static Date parseRss(String rssDate) throws ParseException
DateTimeFormatter.format(java.util.Date)
instead. Since v4.4.
MailDateFormat
to parse the date.
rssDate
- RSS date
ParseException
- if string parsing failsformat(java.util.Date)
@Deprecated public String format()
DateTimeFormatter.format(java.util.Date)
instead. Since v4.4.
DateTimeStyle.RELATIVE
.
format(java.util.Date)
@Deprecated public String format(Date date)
DateTimeFormatter.format(java.util.Date)
instead. Since
v4.4.
DateTimeStyle.RELATIVE
.
Note: this only looks into the past. If you want to format dates in a nice way for future dates, use formatSmart(java.util.Date, com.atlassian.jira.web.util.OutlookDate.SmartFormatterModes)
date
- the date to format
public String formatSmart(Date date, OutlookDate.SmartFormatterModes mode)
date
- the date to formatmode
- whether or not to include the time in the printed date
@Deprecated public Date getNow()
Date.Date()
instead. Since v4.4.
@Deprecated public int daysAgo(Date date)
Days.daysBetween(org.joda.time.ReadablePartial, org.joda.time.ReadablePartial)
instead. Since v4.4.
@Deprecated public int daysAgo(Date theDate, Date theReferenceDate)
Days.daysBetween(org.joda.time.ReadablePartial, org.joda.time.ReadablePartial)
instead. Since v4.4.
TODAY
), between the reference date and the midnight before previous (YESTERDAY
), or between
the reference date and 7 midnights ago (THIS_WEEK
). If the passed in date does not fall in any of the
mentioned ranges, the method returns OTHER
.
theDate
- the date we are asking abouttheReferenceDate
- the reference date (usually today's date)
TODAY
, YESTERDAY
, THIS_WEEK
or OTHER
@Deprecated public Date parseCompleteDateTime(String value) throws ParseException
DateTimeFormatter.parse(String)
instead. Since v4.4.
COMPLETE
format, using the current user's time zone and
locale if possible. If there is no currently logged in user, or if the currently logged in user has not
configured a time zone and/or locale the JIRA default time zone and/or locale is used.
ParseException
@Deprecated public Date parseDatePicker(String value) throws ParseException
DateTimeFormatter.parse(String)
instead. Since v4.4.
DATE_PICKER
or DATE_TIME_PICKER
format, using the current user's time zone and locale if possible. If there is no currently
logged in user, or if the currently logged in user has not configured a time zone and/or locale the JIRA default
time zone and/or locale is used.
ParseException
@Deprecated public Date parseDateTimePicker(String value) throws ParseException
DateTimeFormatter.parse(String)
instead. Since v4.4.
DATE_TIME_PICKER
format, using the current user's
time zone and locale if possible. If there is no currently logged in user, or if the currently logged in user has
not configured a time zone and/or locale the JIRA default time zone and/or locale is used.
ParseException
@Deprecated public String getDatePickerFormat()
DateTimeFormatter.getFormatHint()
instead. Since v4.4.
public String getDatePickerFormatSample(Date date)
DateTimeFormatter.format(java.util.Date)
instead. Since
v4.4.
public String getDateTimePickerFormatSample(Date date)
DateTimeFormatter.format(java.util.Date)
instead. Since
v4.4.
public boolean isDatePickerDate(String value)
@Deprecated public String getDateTimePickerFormat()
DateTimeFormatter.getFormatHint()
instead. Since v4.4.
@Deprecated public String getCompleteDateTimeFormat()
DateTimeFormatter.getFormatHint()
instead. Since v4.4.
@Deprecated public DateFormat getCompleteDateFormat()
DateTimeFormatter.getFormatHint()
instead. Since v4.4.
DateFormat
based on the run-time value of APKeys.JIRA_LF_DATE_COMPLETE
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |