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.ZonedDateTimecopyTimePart(java.time.ZonedDateTime source, java.time.ZonedDateTime destination)static java.time.ZonedDateTimeendOfToday(java.time.ZoneId zoneId)java.lang.StringfixJRA62769(java.lang.String startDate)static longgetDaysBetween(java.time.ZonedDateTime startDate, java.time.ZonedDateTime endDate)com.atlassian.jira.util.I18nHelpergetI18nHelper()java.text.SimpleDateFormatgetISODateFormatter()java.text.SimpleDateFormatgetISODateTimeFormatter()java.text.SimpleDateFormatgetJSDateFormatter()java.text.SimpleDateFormatgetJSDateTimeFormatter()java.text.SimpleDateFormatgetServerDateFormatter()java.text.SimpleDateFormatgetServerDateTimeFormatter()TimeZoneManagergetTimeZoneManager()java.time.ZonedDateTimeparseWithFormatter(java.lang.String text, java.text.SimpleDateFormat df)java.time.ZonedDateTimeparseWithISODateFormat(java.lang.String text)java.time.ZonedDateTimeparseWithISODateTimeFormat(java.lang.String text)java.time.ZonedDateTimeparseWithJSDateFormat(java.lang.String text)java.time.ZonedDateTimeparseWithJSDateTimeFormat(java.lang.String text)java.time.ZonedDateTimeparseWithServerDateFormat(java.lang.String text)java.time.ZonedDateTimeparseWithServerDateTimeFormat(java.lang.String text)static java.time.ZonedDateTimestartOfToday(java.time.ZoneId zoneId)static java.util.DatetoDate(java.time.ZonedDateTime dateTime)java.lang.StringtoISODateString(java.time.ZonedDateTime date)java.lang.StringtoJSDateString(java.time.ZonedDateTime date)java.lang.StringtoJSDateString(java.util.Date date)java.lang.StringtoJSDateTimeString(java.time.ZonedDateTime date)java.lang.StringtoJSDateTimeString(java.util.Date date)java.lang.StringtoServerDateString(java.time.ZonedDateTime date)java.lang.StringtoServerDateTimeString(java.time.ZonedDateTime date)java.lang.StringtoServerDateTimeString(java.util.Date date)static java.time.ZonedDateTimewithEndOfDay(java.time.ZonedDateTime dateTime)static java.time.ZonedDateTimewithStartOfDay(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
-