Package com.deniz.jira.worklog.utils
Class DateTimeHelper
java.lang.Object
com.deniz.jira.worklog.utils.DateTimeHelper
public class DateTimeHelper
extends java.lang.Object
Utility methods for dealing with date and time.
-
Constructor Summary
Constructors Constructor Description DateTimeHelper(TimeZoneManager timeZoneManager, com.atlassian.jira.config.properties.ApplicationProperties applicationProperties, com.atlassian.jira.security.JiraAuthenticationContext authenticationContext)
-
Method Summary
Modifier and Type Method Description static java.time.ZonedDateTime
copyTimePart(java.time.ZonedDateTime source, java.time.ZonedDateTime destination)
static java.time.ZonedDateTime
endOfToday(java.time.ZoneId zoneId)
java.lang.String
fixJRA62769(java.lang.String startDate)
static long
getDaysBetween(java.time.ZonedDateTime startDate, java.time.ZonedDateTime endDate)
com.atlassian.jira.util.I18nHelper
getI18nHelper()
java.text.SimpleDateFormat
getISODateFormatter()
java.text.SimpleDateFormat
getISODateTimeFormatter()
java.text.SimpleDateFormat
getJSDateFormatter()
java.text.SimpleDateFormat
getJSDateTimeFormatter()
java.text.SimpleDateFormat
getServerDateFormatter()
java.text.SimpleDateFormat
getServerDateTimeFormatter()
TimeZoneManager
getTimeZoneManager()
java.time.ZonedDateTime
parseWithFormatter(java.lang.String text, java.text.SimpleDateFormat df)
java.time.ZonedDateTime
parseWithISODateFormat(java.lang.String text)
java.time.ZonedDateTime
parseWithISODateTimeFormat(java.lang.String text)
java.time.ZonedDateTime
parseWithJSDateFormat(java.lang.String text)
java.time.ZonedDateTime
parseWithJSDateTimeFormat(java.lang.String text)
java.time.ZonedDateTime
parseWithServerDateFormat(java.lang.String text)
java.time.ZonedDateTime
parseWithServerDateTimeFormat(java.lang.String text)
static java.time.ZonedDateTime
startOfToday(java.time.ZoneId zoneId)
static java.util.Date
toDate(java.time.ZonedDateTime dateTime)
java.lang.String
toISODateString(java.time.ZonedDateTime date)
java.lang.String
toJSDateString(java.time.ZonedDateTime date)
java.lang.String
toJSDateString(java.util.Date date)
java.lang.String
toJSDateTimeString(java.time.ZonedDateTime date)
java.lang.String
toJSDateTimeString(java.util.Date date)
java.lang.String
toServerDateString(java.time.ZonedDateTime date)
java.lang.String
toServerDateTimeString(java.time.ZonedDateTime date)
java.lang.String
toServerDateTimeString(java.util.Date date)
static java.time.ZonedDateTime
withEndOfDay(java.time.ZonedDateTime dateTime)
static java.time.ZonedDateTime
withStartOfDay(java.time.ZonedDateTime dateTime)
-
Constructor Details
-
DateTimeHelper
public DateTimeHelper(TimeZoneManager timeZoneManager, com.atlassian.jira.config.properties.ApplicationProperties applicationProperties, com.atlassian.jira.security.JiraAuthenticationContext authenticationContext)
-
-
Method Details
-
copyTimePart
public static java.time.ZonedDateTime copyTimePart(java.time.ZonedDateTime source, java.time.ZonedDateTime destination) -
getDaysBetween
public static long getDaysBetween(java.time.ZonedDateTime startDate, java.time.ZonedDateTime endDate) -
getI18nHelper
public com.atlassian.jira.util.I18nHelper getI18nHelper() -
toDate
public static java.util.Date toDate(java.time.ZonedDateTime dateTime) -
endOfToday
public static java.time.ZonedDateTime endOfToday(java.time.ZoneId zoneId) -
startOfToday
public static java.time.ZonedDateTime startOfToday(java.time.ZoneId zoneId) -
toISODateString
public java.lang.String toISODateString(java.time.ZonedDateTime date) -
toServerDateTimeString
public java.lang.String toServerDateTimeString(java.time.ZonedDateTime date) -
toServerDateTimeString
public java.lang.String toServerDateTimeString(java.util.Date date) -
toServerDateString
public java.lang.String toServerDateString(java.time.ZonedDateTime date) -
toJSDateTimeString
public java.lang.String toJSDateTimeString(java.time.ZonedDateTime date) -
toJSDateTimeString
public java.lang.String toJSDateTimeString(java.util.Date date) -
toJSDateString
public java.lang.String toJSDateString(java.time.ZonedDateTime date) -
toJSDateString
public java.lang.String toJSDateString(java.util.Date date) -
parseWithISODateTimeFormat
public java.time.ZonedDateTime parseWithISODateTimeFormat(java.lang.String text) throws java.text.ParseException- Throws:
java.text.ParseException
-
parseWithISODateFormat
public java.time.ZonedDateTime parseWithISODateFormat(java.lang.String text) throws java.text.ParseException- Throws:
java.text.ParseException
-
getServerDateTimeFormatter
public java.text.SimpleDateFormat getServerDateTimeFormatter() -
parseWithServerDateTimeFormat
public java.time.ZonedDateTime parseWithServerDateTimeFormat(java.lang.String text) throws java.text.ParseException- Throws:
java.text.ParseException
-
parseWithServerDateFormat
public java.time.ZonedDateTime parseWithServerDateFormat(java.lang.String text) throws java.text.ParseException- Throws:
java.text.ParseException
-
parseWithJSDateTimeFormat
public java.time.ZonedDateTime parseWithJSDateTimeFormat(java.lang.String text) throws java.text.ParseException- Throws:
java.text.ParseException
-
parseWithJSDateFormat
public java.time.ZonedDateTime parseWithJSDateFormat(java.lang.String text) throws java.text.ParseException- Throws:
java.text.ParseException
-
parseWithFormatter
public java.time.ZonedDateTime parseWithFormatter(java.lang.String text, java.text.SimpleDateFormat df) throws java.text.ParseException- Throws:
java.text.ParseException
-
getServerDateFormatter
public java.text.SimpleDateFormat getServerDateFormatter() -
getISODateTimeFormatter
public java.text.SimpleDateFormat getISODateTimeFormatter() -
getISODateFormatter
public java.text.SimpleDateFormat getISODateFormatter() -
getJSDateTimeFormatter
public java.text.SimpleDateFormat getJSDateTimeFormatter() -
getJSDateFormatter
public java.text.SimpleDateFormat getJSDateFormatter() -
withEndOfDay
public static java.time.ZonedDateTime withEndOfDay(java.time.ZonedDateTime dateTime) -
withStartOfDay
public static java.time.ZonedDateTime withStartOfDay(java.time.ZonedDateTime dateTime) -
fixJRA62769
public java.lang.String fixJRA62769(java.lang.String startDate) -
getTimeZoneManager
-