com.atlassian.jira.util
Class DateFieldFormatImpl

java.lang.Object
  extended by 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 Summary
DateFieldFormatImpl(DateTimeFormatterFactory dateTimeFormatterFactory)
           
 
Method Summary
 String format(Date date)
          Formats a date using the JIRA date format.
 String formatDatePicker(Date date)
          Formats the given date for usage in a date picker.
 String getFormatHint()
          Returns a string containing the format that this class is capable of parsing.
 boolean isParseable(String releaseDate)
          Returns a boolean indicating whether the given text contains a valid date.
 Date parseDatePicker(String text)
          Returns a date that is obtained by parsing the given text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateFieldFormatImpl

public DateFieldFormatImpl(DateTimeFormatterFactory dateTimeFormatterFactory)
Method Detail

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

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

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


Copyright © 2002-2013 Atlassian. All Rights Reserved.