code: public HashMap addEvent(String date, boolean useTemp) {
          HashMap ret = new HashMap();
          if (useTemp) {
              ret.putAll(template);
          } else {
              ret.put("event", eventType);
          }
          ret.put("date", date);
          getInertIndex(ret);
          events.add(next, ret);
          return ret;
      }
docs: Add a new event into array with selected event type and input date.
  
  @param date The event date
  @param useTemp True for using template to create new data
  @return The generated event data map