net.fortuna.ical4j.model.Date.toString()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中net.fortuna.ical4j.model.Date.toString()方法的一些代码示例,展示了Date.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Date.toString()方法的具体详情如下:
包路径:net.fortuna.ical4j.model.Date
类名称:Date
方法名:toString

Date.toString介绍

暂无

代码示例

代码示例来源:origin: caldav4j/caldav4j

protected Map<String, String> getAttributes() {
  Map<String, String> m = new LinkedHashMap<>();
  if (start != null) {
    m.put(ATTR_START, start.toString());
  }
  if (end != null) {
    m.put(ATTR_END, end.toString());
  }
  return m;
}

代码示例来源:origin: ical4j/ical4j

/**
 * {@inheritDoc}
 */
public final String toString() {
  return super.toString() + 'T' +
      time.toString();
}

代码示例来源:origin: org.bedework/bw-ical4j-cl

/**
 * {@inheritDoc}
 */
public final String toString() {
  final StringBuffer b = new StringBuffer(super.toString());
  b.append('T');
  b.append(time.toString());
  return b.toString();
}

代码示例来源:origin: org.mnode.ical4j/ical4j

/**
 * {@inheritDoc}
 */
public final String toString() {
  return super.toString() + 'T' +
      time.toString();
}

代码示例来源:origin: org.bedework.ical4j/ical4j

/**
 * {@inheritDoc}
 */
public final String toString() {
  String b = super.toString() + 'T' +
      time.toString();
  return b;
}

代码示例来源:origin: net.oneandone.ical4j/ical4j

/**
 * {@inheritDoc}
 */
public final String toString() {
  return super.toString() + 'T' +
      time.toString();
}

代码示例来源:origin: caldav4j/caldav4j

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;
}

代码示例来源:origin: org.mnode.ical4j/ical4j

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;
}

代码示例来源:origin: org.bedework.ical4j/ical4j

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;
}

代码示例来源:origin: org.bedework/bw-ical4j-cl

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;
}

代码示例来源:origin: ical4j/ical4j

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;
}

代码示例来源:origin: net.oneandone.ical4j/ical4j

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;
}

代码示例来源:origin: ical4j/ical4j

/**
 * 
 */
public void testToString() {
  assertEquals(expectedString, date.toString());
}

代码示例来源:origin: ical4j/ical4j

public String getName() {
  return super.getName() + " [" + date.toString() + "]";
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade

/**
 * @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);
}

代码示例来源:origin: micromata/projectforge

@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());
}

代码示例来源:origin: 1and1/cosmo

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();
  }
}

代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-ical

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;
}

代码示例来源:origin: ical4j/ical4j

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()); 
  } 
}

代码示例来源:origin: ical4j/ical4j

/**
   * @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;
  }
}

相关文章