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 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

      public TimeZoneManager getTimeZoneManager()