java.lang.Object
com.github.hypfvieh.util.DateUtil

public final class DateUtil extends Object
Utility functions to work with LocalDate, LocalTime and LocalDateTime.
Seit:
v1.2.1 - 2024-09-20
Autor:
hypfvieh
  • Methodendetails

    • isBeforeEqual

      public static boolean isBeforeEqual(LocalDate _first, LocalDate _second)
      Checks if the first date is before or equal to the second date.
      Parameter:
      _first - first date
      _second - second date
      Gibt zurück:
      false if any null or second date after first date
    • isAfterEqual

      public static boolean isAfterEqual(LocalDate _first, LocalDate _second)
      Checks if the first date is after or equal to the second date.
      Parameter:
      _first - first date
      _second - second date
      Gibt zurück:
      false if any null or second date before first date
    • isEqual

      public static boolean isEqual(LocalDate _first, LocalDate _second)
      Null-safe equal comparison of two LocalDate objects.
      Parameter:
      _first - first date
      _second - second date
      Gibt zurück:
      true if equal
    • isBeforeEqual

      public static boolean isBeforeEqual(LocalDateTime _first, LocalDateTime _second)
      Checks if the first timestamp is before or equal to the second timestamp.
      Parameter:
      _first - first timestamp
      _second - second timestamp
      Gibt zurück:
      false if any null or second timestamp after first timestamp
    • isAfterEqual

      public static boolean isAfterEqual(LocalDateTime _first, LocalDateTime _second)
      Checks if the first timestamp is after or equal to the second timestamp.
      Parameter:
      _first - first timestamp
      _second - second timestamp
      Gibt zurück:
      false if any null or second timestamp before first timestamp
    • isEqual

      public static boolean isEqual(LocalDateTime _first, LocalDateTime _second)
      Null-safe equal comparison of two LocalDateTime objects.
      Parameter:
      _first - first datetime
      _second - second datetime
      Gibt zurück:
      true if equal
    • isBeforeEqual

      public static boolean isBeforeEqual(LocalTime _first, LocalTime _second)
      Checks if the first time is before or equal to the second time.
      Parameter:
      _first - first time
      _second - second time
      Gibt zurück:
      false if any null or second time after first time
    • isAfterEqual

      public static boolean isAfterEqual(LocalTime _first, LocalTime _second)
      Checks if the first time is after or equal to the second time.
      Parameter:
      _first - first time
      _second - second time
      Gibt zurück:
      false if any null or second time before first time
    • isEqual

      public static boolean isEqual(LocalTime _first, LocalTime _second)
      Null-safe equal comparison of two LocalTime objects.
      Parameter:
      _first - first time
      _second - second time
      Gibt zurück:
      true if equal
    • isDateBetween

      public static boolean isDateBetween(LocalDate _start, LocalDate _end, LocalDate _test)
      Check if date is in range.
      Parameter:
      _start - range start date
      _end - range end date
      _test - date to check
      Gibt zurück:
      true if in range