/** * @param dt to reformat to ical format * @return rfc5545 date or date/time */ public static String getIcalFormatDateTime(final XMLGregorianCalendar dt) { if (dt == null) { return null; } return getIcalFormatDateTime(dt.toXMLFormat()); }
@Override public ValueComparator convert(final UtcDatetimePropertyType val) { ValueComparator vc = new ValueComparator(); vc.addValue(XcalTags.utcDateTimeVal, XcalUtil.getIcalFormatDateTime( val.getUtcDateTime().toString())); return vc; }
@Override public ValueComparator convert(final DatetimePropertyType val) { ValueComparator vc = new ValueComparator(); vc.addValue(XcalTags.dateTimeVal, XcalUtil.getIcalFormatDateTime( val.getDateTime().toString())); return vc; }
/** * @param dt * @return DtTzid filled in */ public static DtTzid getDtTzid(final DateDatetimePropertyType dt) { DtTzid res = new DtTzid(); ArrayOfParameters aop = dt.getParameters(); if (aop != null) { for (JAXBElement<? extends BaseParameterType> e: aop.getBaseParameter()) { if (e.getName().equals(XcalTags.tzid)) { res.tzid = ((TzidParamType)e.getValue()).getText(); break; } } } res.dateOnly = dt.getDate() != null; if (res.dateOnly) { res.dt = getIcalFormatDateTime(dt.getDate().toString()); } else { res.dt = getIcalFormatDateTime(dt.getDateTime().toString()); } return res; }
type.equals("time")) { bs.getContentHandler().propertyValue( XcalUtil.getIcalFormatDateTime(textField(parser))); return true; sb.append(XcalUtil.getIcalFormatDateTime(parts[0])); sb.append(XcalUtil.getIcalFormatDateTime(parts[1]));
private static TimeRange makeTimeRange(final UTCTimeRangeType utr) throws WebdavException { if (utr == null) { return null; } try { DateTime st = null; DateTime et = null; if (utr.getStart() != null) { st = new DateTime(XcalUtil.getIcalFormatDateTime(utr.getStart())); } if (utr.getEnd() != null) { et = new DateTime(XcalUtil.getIcalFormatDateTime(utr.getEnd())); } if ((st == null) && (et == null)) { throw new WebdavForbidden(CaldavTags.validFilter, "Invalid time-range - no start and no end"); } if ((st != null) && !st.isUtc()) { throw new WebdavForbidden(CaldavTags.validFilter, "Invalid time-range - start not UTC"); } if ((et != null) && !et.isUtc()) { throw new WebdavForbidden(CaldavTags.validFilter, "Invalid time-range - end not UTC"); } return new TimeRange(st, et); } catch (final WebdavException wde) { throw wde; } catch (final Throwable t) { throw new WebdavForbidden(CaldavTags.validFilter, "Invalid time-range"); } }
UtcDatetimePropertyType p = (UtcDatetimePropertyType)prop; propVal(bs, XcalUtil.getIcalFormatDateTime(p.getUtcDateTime().toString())); DatetimePropertyType p = (DatetimePropertyType)prop; propVal(bs, XcalUtil.getIcalFormatDateTime(p.getDateTime().toString())); propVal(bs, p.getDuration()); } else { propVal(bs, XcalUtil.getIcalFormatDateTime(p.getDateTime().toString()));
ba.setTrigger(XcalUtil.getIcalFormatDateTime(tr.getDateTime())); ba.setTriggerDateTime(true); } else {