code: protected Calendar getLocalTimeAsCalendar(BigDecimal localTimeParam, Calendar date) {
          if (localTimeParam == null) {
              return null;
          }
  
          // Create a clone of the input calendar so we get locale/timezone information.
          Calendar resultTime = (Calendar) date.clone();
  
          BigDecimal localTime = localTimeParam;
          if (localTime.compareTo(BigDecimal.ZERO) == -1) {
              localTime = localTime.add(BigDecimal.valueOf(24.0D));
              resultTime.add(Calendar.HOUR_OF_DAY, -24);
          }
          String[] timeComponents = localTime.toPlainString().split("\\.");
          int hour = Integer.parseInt(timeComponents[0]);
  
          BigDecimal minutes = new BigDecimal("0." + timeComponents[1]);
          minutes = minutes.multiply(BigDecimal.valueOf(60)).setScale(0, RoundingMode.HALF_EVEN);
          if (minutes.intValue() == 60) {
              minutes = BigDecimal.ZERO;
              hour += 1;
          }
          if (hour == 24) {
              hour = 0;
          }
  
          // Set the local time
          resultTime.set(Calendar.HOUR_OF_DAY, hour);
          resultTime.set(Calendar.MINUTE, minutes.intValue());
          resultTime.set(Calendar.SECOND, 0);
          resultTime.set(Calendar.MILLISECOND, 0);
          resultTime.setTimeZone(date.getTimeZone());
  
          return resultTime;
      }
docs: Returns the local rise/set time in the form HH:MM.
  
  @param localTimeParam
  <code>BigDecimal</code> representation of the local rise/set time.
  @return <code>Calendar</code> representation of the local time as a calendar, or null for none.