Class DateFieldFormatImpl

java.lang.Object
com.atlassian.jira.util.DateFieldFormatImpl
All Implemented Interfaces:
DateFieldFormat

public class DateFieldFormatImpl extends Object implements DateFieldFormat
Default implementation for formatting and parsing dates in JIRA.
Since:
v4.4
  • Constructor Details

  • Method Details

    • format

      public String format(Date date)
      Description copied from interface: DateFieldFormat
      Formats a date using the JIRA date format.
      Specified by:
      format in interface DateFieldFormat
      Parameters:
      date - a Date
      Returns:
      a String containing a formatted date
    • formatDateInUserTimeZone

      public String formatDateInUserTimeZone(Date date)
      Description copied from interface: DateFieldFormat
      Formats a date using the JIRA date format and in the timezone of the logged in user.
      Specified by:
      formatDateInUserTimeZone in interface DateFieldFormat
      Parameters:
      date - a Date
      Returns:
      a String containing a formatted date
    • formatDatePicker

      public String formatDatePicker(Date date)
      Description copied from interface: DateFieldFormat
      Formats the given date for usage in a date picker.
      Specified by:
      formatDatePicker in interface DateFieldFormat
      Parameters:
      date - a Date
      Returns:
      a String containing a formatted date
    • parseDatePicker

      public Date parseDatePicker(String text) throws IllegalArgumentException
      Description copied from interface: DateFieldFormat
      Returns 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:
      parseDatePicker in interface DateFieldFormat
      Parameters:
      text - a String representation of a date
      Returns:
      a Date
      Throws:
      IllegalArgumentException - if the text cannot be parsed
    • parseDatePickerInUserTimeZone

      public Date parseDatePickerInUserTimeZone(String text) throws IllegalArgumentException
      Description copied from interface: DateFieldFormat
      Returns 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:
      parseDatePickerInUserTimeZone in interface DateFieldFormat
      Parameters:
      text - a String representation of a date
      Returns:
      a Date
      Throws:
      IllegalArgumentException - if the text cannot be parsed
    • isParseable

      public boolean isParseable(String releaseDate)
      Description copied from interface: DateFieldFormat
      Returns a boolean indicating whether the given text contains a valid date.
      Specified by:
      isParseable in interface DateFieldFormat
      Parameters:
      releaseDate - a String representation of a date
      Returns:
      a boolean indicating whether the given text contains a valid date
    • getFormatHint

      public String getFormatHint()
      Description copied from interface: DateFieldFormat
      Returns a string containing the format that this class is capable of parsing.
      Specified by:
      getFormatHint in interface DateFieldFormat
      Returns:
      a String containing the format hint