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
175956
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;
    }
329019
function getEvents (date) {
  date = this.toDate(date);
  if (!date) {
    return null;
  }
  var info = getDayInfo(this.dayInfo, date);
  return info ? info.events : [];
}
1358006
public static Event map(EventType eventType) {
        Event event = new Event();
        event.setEventType(mapEventTypeEnum(eventType.getEventType()));
        Date date = (eventType.getTimestamp() == null)
                ? new Date() : eventType.getTimestamp().toGregorianCalendar().getTime();
        event.setTimestamp(date);
        event.setOriginator(mapOriginatorType(eventType.getOriginator()));
        MessageInfo messageInfo = mapMessageInfo(eventType.getMessageInfo());
        event.setMessageInfo(messageInfo);
        String content = mapContent(eventType.getContent());
        event.setContent(content);
        event.getCustomInfo().clear();
        event.getCustomInfo().putAll(mapCustomInfo(eventType.getCustomInfo()));
        return event;
    }
513786
public static <T extends Comparable<?>> DateTemplate<T> dateTemplate(Class<? extends T> cl,
                                                                         String template, Object... args) {
        return dateTemplate(cl, createTemplate(template), ImmutableList.copyOf(args));
    }
45488
public static <T extends Comparable<?>> DateTemplate<T> dateTemplate(Class<? extends T> cl, Template template, List<?> args) {
        return new DateTemplate<T>(cl, template, ImmutableList.copyOf(args));
    }
118027
private static Calendar buildCalendar(final Date date) {

    Calendar calendar = buildCalendar();
    calendar.setTime(date);
    return calendar;
  }
475477
@Override
    public Map<String, String> getValues() {
        HashMap<String, String> result = new HashMap<>();

        if (type != EventType.ALL) {
            result.put("eventtype", type.name());
        }

        if (beforeDate != null) result.put("beforeDate", Long.toString(beforeDate));
        if (afterDate != null) result.put("afterDate", Long.toString(afterDate));

        return result;
    }
638206
public String format(Date date) {
		Calendar cal = new GregorianCalendar();
		cal.setTime(date);
		return DatatypeConverter.printDateTime(cal);
	}
255676
public void setCreatedDate(Date createdDate) {
        _createdDate = createdDate == null ? null : new Date(createdDate.getTime());
    }
331903
private MonthCellWithMonthIndex getMonthCellWithIndexByDate(Date date) {
    Calendar searchCal = Calendar.getInstance(timeZone, locale);
    searchCal.setTime(date);
    String monthKey = monthKey(searchCal);
    Calendar actCal = Calendar.getInstance(timeZone, locale);

    int index = cells.getIndexOfKey(monthKey);
    List<List<MonthCellDescriptor>> monthCells = cells.get(monthKey);
    for (List<MonthCellDescriptor> weekCells : monthCells) {
      for (MonthCellDescriptor actCell : weekCells) {
        actCal.setTime(actCell.getDate());
        if (sameDate(actCal, searchCal) && actCell.isSelectable()) {
          return new MonthCellWithMonthIndex(actCell, index);
        }
      }
    }
    return null;
  }
1017224
public String formatDate(Date date, int type)
    {
        String string = null;
        if (type == DBConstants.DATE_TIME_FORMAT)
            string = XmlUtilities.dateTimeFormat.format(date);
        else if (type == DBConstants.DATE_ONLY_FORMAT)
            string = XmlUtilities.dateFormat.format(date);
        else if (type == DBConstants.TIME_ONLY_FORMAT)
            string = XmlUtilities.timeFormat.format(date);
        return string;
    }
1200990
public void setDate(AjaxRequestTarget ajaxRequestTarget, DateOption dateOption)
	{
		ajaxRequestTarget.appendJavaScript(this.setDate(dateOption).render().toString());
	}
1348828
public static Timestamp toTimestamp(final Date date)
	{
		final Calendar cal = new GregorianCalendar();
		cal.setTime(date);
		cal.set(Calendar.HOUR_OF_DAY, 0);
		cal.set(Calendar.MINUTE, 0);
		cal.set(Calendar.SECOND, 0);
		cal.set(Calendar.MILLISECOND, 0);

		return new Timestamp(cal.getTime().getTime());
	}
355128
public B timerWithDate(String timerDate) {
    TimeDate timeDate = createInstance(TimeDate.class);
    timeDate.setTextContent(timerDate);

    TimerEventDefinition timerEventDefinition = createInstance(TimerEventDefinition.class);
    timerEventDefinition.setTimeDate(timeDate);

    element.getEventDefinitions().add(timerEventDefinition);

    return myself;
  }
1290751
function(date) {
        var tooEarly = this.minDate && date < this.minDate,
            tooLate = this.maxDate && date > this.maxDate;

        if (this.method == 'between') {
            if (tooEarly)
                return true;
            if (tooLate)
                return false;
        } else if (this.method == 'before') {
            if (tooLate)
                return false;
        } else if (this.method == 'after') {
            if (tooEarly)
                return true;
            this.add(date);
            return false;
        }

        return this.add(date);

    }
635335
private static Calendar getCalendar(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        return calendar;
    }
1187648
public static StringBuilder append(Date date, StringBuilder sb) {
        return formatter().append0(checkNotNull(date, "date"), checkNotNull(sb, "sb"));
    }