/** * {@inheritDoc} */ public final String toString() { return super.toString() + 'T' + time.toString(); }
/** * {@inheritDoc} */ public final String toString() { final StringBuffer b = new StringBuffer(super.toString()); b.append('T'); b.append(time.toString()); return b.toString(); }
/** * {@inheritDoc} */ public final String toString() { return super.toString() + 'T' + time.toString(); }
/** * {@inheritDoc} */ public final String toString() { String b = super.toString() + 'T' + time.toString(); return b; }
/** * {@inheritDoc} */ public final String toString() { return super.toString() + 'T' + time.toString(); }
protected Collection<? extends XmlSerializable> getChildren() { ArrayList<XmlSerializable> children = new ArrayList<>(); if (comp != null) { children.add(comp); } if (expandOrLimitRecurrenceSet != null) { String elemName = EXPAND.equals(expandOrLimitRecurrenceSet) ? ELEM_EXPAND_RECURRENCE_SET : ELEM_LIMIT_RECURRENCE_SET; PropProperty expandOrLimitElement = new PropProperty(elemName, CalDAVConstants.NAMESPACE_CALDAV); expandOrLimitElement.addAttribute(ATTR_START, recurrenceSetStart.toString()); expandOrLimitElement.addAttribute(ATTR_END, recurrenceSetEnd.toString()); children.add(expandOrLimitElement); } return children; }
private DateTime calculateOnset(String dateStr) throws ParseException { // Translate local onset into UTC time by parsing local time // as GMT and adjusting by TZOFFSETFROM if required long utcOnset; synchronized (UTC_FORMAT) { utcOnset = UTC_FORMAT.parse(dateStr).getTime(); } // return a UTC DateTime onset = new DateTime(true); onset.setTime(utcOnset); return onset; }
private DateTime calculateOnset(String dateStr) throws ParseException { // Translate local onset into UTC time by parsing local time // as GMT and adjusting by TZOFFSETFROM if required long utcOnset; synchronized (UTC_FORMAT) { utcOnset = UTC_FORMAT.parse(dateStr).getTime(); } // return a UTC DateTime onset = new DateTime(true); onset.setTime(utcOnset); return onset; }
private DateTime calculateOnset(String dateStr) throws ParseException { // Translate local onset into UTC time by parsing local time // as GMT and adjusting by TZOFFSETFROM if required long utcOnset; synchronized (UTC_FORMAT) { utcOnset = UTC_FORMAT.parse(dateStr).getTime(); } // return a UTC DateTime onset = new DateTime(true); onset.setTime(utcOnset); return onset; }
private DateTime calculateOnset(String dateStr) throws ParseException { // Translate local onset into UTC time by parsing local time // as GMT and adjusting by TZOFFSETFROM if required long utcOnset; synchronized (UTC_FORMAT) { utcOnset = UTC_FORMAT.parse(dateStr).getTime(); } // return a UTC DateTime onset = new DateTime(true); onset.setTime(utcOnset); return onset; }
private DateTime calculateOnset(String dateStr) throws ParseException { // Translate local onset into UTC time by parsing local time // as GMT and adjusting by TZOFFSETFROM if required long utcOnset; synchronized (UTC_FORMAT) { utcOnset = UTC_FORMAT.parse(dateStr).getTime(); } // return a UTC DateTime onset = new DateTime(true); onset.setTime(utcOnset); return onset; }
/** * */ public void testToString() { assertEquals(expectedString, date.toString()); }
public String getName() { return super.getName() + " [" + date.toString() + "]"; }
/** * @param val * @return initialised BwDateTime * @throws CalFacadeException */ public static BwDateTime makeBwDateTime(final Date val) throws CalFacadeException { String tzid = null; boolean dateType = true; if (val instanceof DateTime) { dateType = false; TimeZone tz = ((DateTime)val).getTimeZone(); if (tz != null) { tzid = tz.getID(); } } return makeBwDateTime(dateType, val.toString(), tzid); }
@Test public void testSqlDate() { final net.fortuna.ical4j.model.Date date = ICal4JUtils.getICal4jDate( DateHelper.parseIsoDate("2012-12-22", DateHelper.EUROPE_BERLIN), DateHelper.EUROPE_BERLIN); Assert.assertEquals("20121222", date.toString()); }
private String fromDateToStringNoTimezone(Date date) { if(date==null) { return null; } if(date instanceof DateTime) { DateTime dt = (DateTime) date; // If DateTime has a timezone, then convert to UTC before // serializing as String. if(dt.getTimeZone()!=null) { // clone instance first to prevent changes to original instance DateTime copy = new DateTime(dt); copy.setUtc(true); return copy.toString(); } else { return dt.toString(); } } else { return date.toString(); } }
private static Date makeZonedDt(final BwEvent val, final String dtval) throws Throwable { BwDateTime dtstart = val.getDtstart(); Date dt = new DateTime(dtval); if (dtstart.getDateType()) { // RECUR - fix all day recurrences sometime if (dtval.length() > 8) { // Try to fix up bad all day recurrence ids. - assume a local timezone ((DateTime)dt).setTimeZone(null); return new Date(dt.toString().substring(0, 8)); } return dt; } if (val.getForceUTC()) { return dt; } if ((dtstart != null) && !dtstart.isUTC()) { DtStart ds = dtstart.makeDtStart(); ((DateTime)dt).setTimeZone(ds.getTimeZone()); } return dt; }
private void getDates(java.util.Date startRange, java.util.Date endRange, java.util.Date eventStart, Recur recur) { net.fortuna.ical4j.model.Date start = new net.fortuna.ical4j.model.Date(startRange); net.fortuna.ical4j.model.Date end = new net.fortuna.ical4j.model.Date(endRange); net.fortuna.ical4j.model.Date seed = new net.fortuna.ical4j.model.Date(eventStart); DateList dates = recur.getDates(seed, start, end, Value.DATE); for (int i=0; i<dates.size(); i++) { log.info("date_" + i + " = " + dates.get(i).toString()); } }
/** * @return * @throws ParseException */ public static TestSuite suite() throws ParseException { TestSuite suite = new TestSuite(); suite.addTest(new DateListTest(new DateList(), 0)); suite.addTest(new DateListTest(new Date().toString(), Value.DATE, 1)); suite.addTest(new DateListTest(new DateTime().toString(), Value.DATE_TIME, 1)); suite.addTest(new DateListTest(new DateTime(123).toString() + "," + new DateTime(999).toString(), Value.DATE_TIME, 2)); return suite; } }