Package com.atlassian.jira.web.util
Class OutlookDate
java.lang.Object
com.atlassian.jira.web.util.OutlookDate
Deprecated.
Formats and parses dates in a variety of formats, including relative dates such as "Today" and "Last Wednesday".
Warning
As of JIRA 4.4, some of the methods in this class have been retrofitted to be time zone-aware. This means that if you call one of these methods, this class will attempt to determine the time zone of the user that is currently logged in, and will display times in that user's time zone if possible. If the user's time zone can not be determined, or if there is no logged in user, the methods will use the JIRA default user time zone. This is different to the previous behaviour, which was to use the JVM default timezone as returned by TimeZone.getDefault() when displaying dates. Please review each method's JavaDoc to determine whether you are affected by this change in behaviour.- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
Deprecated.static final long
Deprecated.static final long
Deprecated.static final int
Deprecated.static final long
Deprecated.static final int
Deprecated.static final int
Deprecated.static final int
Deprecated. -
Constructor Summary
ConstructorDescriptionOutlookDate
(Locale locale) OutlookDate
(Locale locale, ApplicationProperties applicationProperties) OutlookDate
(Locale locale, ApplicationProperties applicationProperties, I18nHelper.BeanFactory i18nHelperFactory, DateTimeFormatterFactory dateTimeFormatterFactory) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionint
Deprecated.UseDays.daysBetween(org.joda.time.ReadablePartial, org.joda.time.ReadablePartial)
instead.int
Deprecated.UseDays.daysBetween(org.joda.time.ReadablePartial, org.joda.time.ReadablePartial)
instead.Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead.formatDatePicker
(Date date) Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead.formatDateTimePicker
(Date date) Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead.Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead.Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead.formatDMYHMS
(Date date) Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead.formatIso8601
(Date date) Deprecated.formatIso8601Date
(Date date) Deprecated.Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead.formatRssRfc822
(Date date) Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead.formatSmart
(Date date, OutlookDate.SmartFormatterModes mode) Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead.formatTime
(Date date) Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead.Deprecated.UseDateTimeFormatter.getFormatHint()
instead.Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead.boolean
isDatePickerDate
(String value) Deprecated.UseDateTimeFormatter.parse(String)
instead.parseCompleteDateTime
(String value) Deprecated.UseDateTimeFormatter.parse(String)
instead.parseDatePicker
(String value) Deprecated.UseDateTimeFormatter.parse(String)
instead.parseDateTimePicker
(String value) Deprecated.UseDateTimeFormatter.parse(String)
instead.static Date
Deprecated.UseDateTimeFormatter.parse(String)
instead.
-
Field Details
-
SECOND
Deprecated.- See Also:
-
MINUTE
Deprecated.- See Also:
-
HOUR
Deprecated.- See Also:
-
DAY
Deprecated.- See Also:
-
TODAY
Deprecated.- See Also:
-
YESTERDAY
Deprecated.- See Also:
-
THIS_WEEK
Deprecated.- See Also:
-
OTHER
Deprecated.- See Also:
-
-
Constructor Details
-
OutlookDate
@Deprecated public OutlookDate(Locale locale, ApplicationProperties applicationProperties, I18nHelper.BeanFactory i18nHelperFactory, DateTimeFormatterFactory dateTimeFormatterFactory) Deprecated. -
OutlookDate
Deprecated.An old constructor which is left here only for backward compatibility.- Parameters:
locale
-
-
OutlookDate
Deprecated.An old constructor which is left here only for backward compatibility.- Parameters:
locale
-applicationProperties
-
-
-
Method Details
-
formatIso8601
Deprecated.Formats the given date into ISO8601 format. This format contains date and time information and it is used by data marked with hCalendar microformat. If you need to use date information only useformatIso8601Date(java.util.Date)
method instead.- Parameters:
date
- date to format- Returns:
- formatted date string
-
formatIso8601Date
Deprecated.Formats the given date into ISO8601 format. This format contains date information only and it is used by data marked with hCalendar microformat. If you need to use date and time information useformatIso8601(java.util.Date)
method instead.- Parameters:
date
- date to format- Returns:
- formatted date string
-
formatDMY
Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead. Since v4.4.Returns the given date formatted as a String in the current user's time zone if possible, in the format specified byDateTimeStyle.DATE
.- Parameters:
date
- a Date- Returns:
- a String containing the formatted date
-
formatDMYHMS
Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead. Since v5.0.Returns the given date formatted as a String in the current user's time zone if possible, in the format specified byDateTimeStyle.COMPLETE
.- Parameters:
date
- a Date- Returns:
- a String containing the formatted date
-
formatTime
Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead. Since v5.0.Returns the given date formatted as a String in the current user's time zone if possible, in the format specified byDateTimeStyle.TIME
.- Parameters:
date
- a Date- Returns:
- a String containing the formatted date
-
formatDay
Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead. Since v4.4. -
formatDatePicker
Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead. Since v4.4.Returns the given date formatted as a String in the current user's time zone if possible, in the format specified byDateTimeStyle.DATE_PICKER
. -
formatDateTimePicker
Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead. Since v4.4.Returns the given date formatted as a String in the current user's time zone if possible, in the format specified byDateTimeStyle.DATE_TIME_PICKER
. -
formatRss
Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead. Since v5.0.Format a date for RSS feeds. UsesMailDateFormat
to format the given date. Returns an empty string if null is passed in.- Parameters:
date
- date to format- Returns:
- formatted date or empty string
-
formatRssRfc822
Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead. Since v4.4.Formats a date using the correct RFC822 format as indicated in the RSS v2 specification and not using theMailDateFormat
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)
- Parameters:
date
- the date to format into a string- Returns:
- a date string in RFC822 format
- Since:
- v3.10.3
- See Also:
-
parseRss
Deprecated.UseDateTimeFormatter.parse(String)
instead. Since v5.0.Parse a date from RSS feeds. UsesMailDateFormat
to parse the date.- Parameters:
rssDate
- RSS date- Returns:
- new Date created from the given string
- Throws:
ParseException
- if string parsing fails- See Also:
-
format
Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead. Since v4.4.Returns the given date formatted as a String in the current user's time zone if possible, in the format specified byDateTimeStyle.RELATIVE
.- Parameters:
date
- the date to format- Returns:
- the date printed (i18n)
-
formatSmart
Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead. Since v5.0.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. If the date is in the past, we will use terminology such as "last Wednesday" to differentiate it from "Wednesday" (which is in the future).- Parameters:
date
- the date to formatmode
- whether or not to include the time in the printed date- Returns:
- the date printed (i18n)
-
daysAgo
Deprecated.UseDays.daysBetween(org.joda.time.ReadablePartial, org.joda.time.ReadablePartial)
instead. Since v4.4. -
daysAgo
Deprecated.UseDays.daysBetween(org.joda.time.ReadablePartial, org.joda.time.ReadablePartial)
instead. Since v4.4.The method determines whether the date (theDate) lies between the reference date and the previous midnight (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 returnsOTHER
. -
parseCompleteDateTime
Deprecated.UseDateTimeFormatter.parse(String)
instead. Since v4.4.Parses the given text inCOMPLETE
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.- Throws:
ParseException
-
parseDatePicker
Deprecated.UseDateTimeFormatter.parse(String)
instead. Since v4.4.Parses the given text inDATE_PICKER
orDATE_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.- Throws:
ParseException
-
parseDateTimePicker
Deprecated.UseDateTimeFormatter.parse(String)
instead. Since v4.4.Parses the given text inDATE_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.- Throws:
ParseException
-
getDatePickerFormatSample
Deprecated.UseDateTimeFormatter.format(java.util.Date)
instead. Since v4.4. -
isDatePickerDate
Deprecated.UseDateTimeFormatter.parse(String)
instead. Since v5.0.- Parameters:
value
-- Returns:
-
getCompleteDateTimeFormat
Deprecated.UseDateTimeFormatter.getFormatHint()
instead. Since v4.4.
-
DateTimeFormatter
instead. Since v7.1