Class CalendarUtil

java.lang.Object
com.onenetwork.platform.tools.time.CalendarUtil

public class CalendarUtil
extends java.lang.Object
Utility class for Calendar and TimeZone related operations
  • Constructor Summary

    Constructors 
    Constructor Description
    CalendarUtil()  
  • Method Summary

    Modifier and Type Method Description
    static void setNonTzFields​(java.util.Calendar source, java.util.Calendar target)
    Utility method to set the field on the target calendar object to match the fields on the source calendar object.
    static void truncateTime​(java.util.Calendar cal)
    Truncates the time component values for provided calendar instance.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setNonTzFields

      public static void setNonTzFields​(java.util.Calendar source, java.util.Calendar target)
      Utility method to set the field on the target calendar object to match the fields on the source calendar object. This allows one to easily create target calendar same as of the source calendar except for the TimeZone.
      Parameters:
      source - source Calendar instance
      target - target Calendar instance
    • truncateTime

      public static void truncateTime​(java.util.Calendar cal)
      Truncates the time component values for provided calendar instance.
      Parameters:
      cal - calendar instance