@ThreadSafe public final class

JqlLocalDateSupportImpl

extends Object
implements JqlLocalDateSupport
java.lang.Object
   ↳ com.atlassian.jira.jql.util.JqlLocalDateSupportImpl

Class Overview

Default implementation for JqlLocalDateSupport

Summary

Constants
String PATTERN_WITH_HYPHEN
String PATTERN_WITH_SLASH
Public Constructors
JqlLocalDateSupportImpl(Clock clock, TimeZoneManager timeZoneManager)
JqlLocalDateSupportImpl(TimeZoneManager timeZoneManager)
Public Methods
Date convertToDate(LocalDate date)
Converts a LocalDate to a Date using the systems time zone.
LocalDate convertToLocalDate(String dateString)
Try to parse the passed date string using the formats that JQL understands.
LocalDate convertToLocalDate(Long dateLong)
Try to parse the passed date long.
String getIndexedValue(LocalDate date)
Converts a date into the index-friendly format.
String getLocalDateString(LocalDate localDate)
Return a string representation of the passed date.
boolean validate(String dateString)
Check to see if the passed string is a valid date according to JQL.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.jql.util.JqlLocalDateSupport

Constants

public static final String PATTERN_WITH_HYPHEN

Constant Value: "yyyy-MM-dd"

public static final String PATTERN_WITH_SLASH

Constant Value: "yyyy/MM/dd"

Public Constructors

public JqlLocalDateSupportImpl (Clock clock, TimeZoneManager timeZoneManager)

public JqlLocalDateSupportImpl (TimeZoneManager timeZoneManager)

Public Methods

public Date convertToDate (LocalDate date)

Converts a LocalDate to a Date using the systems time zone.

Parameters
date the date to convert. Cannot be null.
Returns
  • return the Date for the local date.

public LocalDate convertToLocalDate (String dateString)

Try to parse the passed date string using the formats that JQL understands. It will consider the user's time zone when parsing the date string.

Parameters
dateString the string to parse. Cannot be empty or null.
Returns
  • the parsed date.

public LocalDate convertToLocalDate (Long dateLong)

Try to parse the passed date long.

Parameters
dateLong the string to parse. Cannot be empty or null.
Returns
  • the parsed date.

public String getIndexedValue (LocalDate date)

Converts a date into the index-friendly format.

Parameters
date the date
Returns
  • a string representing the date, ready for comparison to indexed values.

public String getLocalDateString (LocalDate localDate)

Return a string representation of the passed date. This method should just convert the date into its parseable String representation.

Parameters
localDate the date to convert. Cannot be null.
Returns
  • return the passed date as a string.

public boolean validate (String dateString)

Check to see if the passed string is a valid date according to JQL.

Parameters
dateString the string to check cannot be null.
Returns
  • true if the date is valid; false otherwise.