Package com.atlassian.jira.util
Class DateFieldFormatImpl
java.lang.Object
com.atlassian.jira.util.DateFieldFormatImpl
- All Implemented Interfaces:
DateFieldFormat
Default implementation for formatting and parsing dates in JIRA.
- Since:
- v4.4
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFormats a date using the JIRA date format.formatDateInUserTimeZone(Date date) Formats a date using the JIRA date format and in the timezone of the logged in user.formatDatePicker(Date date) Formats the given date for usage in a date picker.Returns a string containing the format that this class is capable of parsing.booleanisParseable(String releaseDate) Returns a boolean indicating whether the given text contains a valid date.parseDatePicker(String text) Returns a date that is obtained by parsing the given text.Returns a date that is obtained by parsing the given text.
-
Constructor Details
-
DateFieldFormatImpl
-
-
Method Details
-
format
Description copied from interface:DateFieldFormatFormats a date using the JIRA date format.- Specified by:
formatin interfaceDateFieldFormat- Parameters:
date- a Date- Returns:
- a String containing a formatted date
-
formatDateInUserTimeZone
Description copied from interface:DateFieldFormatFormats a date using the JIRA date format and in the timezone of the logged in user.- Specified by:
formatDateInUserTimeZonein interfaceDateFieldFormat- Parameters:
date- a Date- Returns:
- a String containing a formatted date
-
formatDatePicker
Description copied from interface:DateFieldFormatFormats the given date for usage in a date picker.- Specified by:
formatDatePickerin interfaceDateFieldFormat- Parameters:
date- a Date- Returns:
- a String containing a formatted date
-
parseDatePicker
Description copied from interface:DateFieldFormatReturns a date that is obtained by parsing the given text. The string representation of the date is assumed to be in the system time zone.- Specified by:
parseDatePickerin interfaceDateFieldFormat- Parameters:
text- a String representation of a date- Returns:
- a Date
- Throws:
IllegalArgumentException- if the text cannot be parsed
-
parseDatePickerInUserTimeZone
Description copied from interface:DateFieldFormatReturns a date that is obtained by parsing the given text. The string representation of the date is assumed to be in the time zone of the logged in user.- Specified by:
parseDatePickerInUserTimeZonein interfaceDateFieldFormat- Parameters:
text- a String representation of a date- Returns:
- a Date
- Throws:
IllegalArgumentException- if the text cannot be parsed
-
isParseable
Description copied from interface:DateFieldFormatReturns a boolean indicating whether the given text contains a valid date.- Specified by:
isParseablein interfaceDateFieldFormat- Parameters:
releaseDate- a String representation of a date- Returns:
- a boolean indicating whether the given text contains a valid date
-
getFormatHint
Description copied from interface:DateFieldFormatReturns a string containing the format that this class is capable of parsing.- Specified by:
getFormatHintin interfaceDateFieldFormat- Returns:
- a String containing the format hint
-