String toText(Object val) { if (val == null) return null; Date date = null; if (val instanceof java.util.Date) { // also applies to java.sql.Time, java.sql.Timestamp date = (Date) val; return ISO8601DateParser.format((Date) val); } return val.toString(); }
public boolean dateMatch(List<String> dateFilters, Date instanceDate, InstanceFilter filter) { boolean match = true; for (String ddf : dateFilters) { String isoDate = ISO8601DateParser.format(instanceDate); String critDate = Filter.getDateWithoutOp(ddf); if (ddf.startsWith("=")) { if (!isoDate.startsWith(critDate)) match = false; } else if (ddf.startsWith("<=")) { if (!isoDate.startsWith(critDate) && isoDate.compareTo(critDate) > 0) match = false; } else if (ddf.startsWith(">=")) { if (!isoDate.startsWith(critDate) && isoDate.compareTo(critDate) < 0) match = false; } else if (ddf.startsWith("<")) { if (isoDate.compareTo(critDate) > 0) match = false; } else if (ddf.startsWith(">")) { if (isoDate.compareTo(critDate) < 0) match = false; } } return match; }
textVal = ISO8601DateParser.format((Date) simpleType); } else if (simpleType instanceof DurationValue) { textVal = ((DurationValue) simpleType).getStringValue();
textVal = ISO8601DateParser.format((Date) simpleType); } else if (simpleType instanceof DurationValue) { textVal = ((DurationValue)simpleType).getStringValue();
s2 = ""+instanceDAO2.getState(); } else if ("started".equals(orderKey)) { s1 = ISO8601DateParser.format(instanceDAO1.getCreateTime()); s2 = ISO8601DateParser.format(instanceDAO2.getCreateTime()); } else if ("last-active".equals(orderKey)) { s1 = ISO8601DateParser.format(instanceDAO1.getLastActiveTime()); s2 = ISO8601DateParser.format(instanceDAO2.getLastActiveTime());
value = org.apache.ode.utils.ISO8601DateParser.format(d);