/** * Register. * @param timezone The timezone. * @param update The boolean for update. */ // @Override public void register(TimeZone timezone, boolean update) { timezones.put(timezone.getID(), timezone); } }
/** * Register. * @param timezone The timezone. * @param update The boolean for update. */ // @Override public void register(TimeZone timezone, boolean update) { timezones.put(timezone.getID(), timezone); } }
@Override public void register(final TimeZone timezone) { try { TimeZone tz = Timezones.getTz(timezone.getID()); if (tz != null) { // Already three return; } if (localTzs == null) { localTzs = new HashMap<String, TimeZone>(); } localTzs.put(timezone.getID(), timezone); } catch (Throwable t) { throw new RuntimeException(t); } }
public void register(final TimeZone timezone) { try { Timezones.registerTz(timezone.getID(), timezone); } catch (Throwable t) { throw new RuntimeException(t); } }
/** * {@inheritDoc} */ public final void register(final TimeZone timezone, boolean update) { if (update) { try { // load any available updates for the timezone.. timezones.put(timezone.getID(), new TimeZone(timeZoneLoader.loadVTimeZone(timezone.getID()))); } catch (IOException | ParserException | ParseException e) { Logger log = LoggerFactory.getLogger(TimeZoneRegistryImpl.class); log.warn("Error occurred loading VTimeZone", e); } } else { timezones.put(timezone.getID(), timezone); } }
/** * {@inheritDoc} */ public final void register(final TimeZone timezone, boolean update) { if (update) { try { // load any available updates for the timezone.. timezones.put(timezone.getID(), new TimeZone(timeZoneLoader.loadVTimeZone(timezone.getID()))); } catch (IOException | ParserException | ParseException e) { Logger log = LoggerFactory.getLogger(TimeZoneRegistryImpl.class); log.warn("Error occurred loading VTimeZone", e); } } else { timezones.put(timezone.getID(), timezone); } }
/** * {@inheritDoc} */ public final void register(final TimeZone timezone, boolean update) { if (update) { // load any available updates for the timezone.. timezones.put(timezone.getID(), new TimeZone(updateDefinition(timezone.getVTimeZone()))); } else { timezones.put(timezone.getID(), timezone); } }
/** * {@inheritDoc} */ public final void register(final TimeZone timezone, boolean update) { if (update) { // load any available updates for the timezone.. timezones.put(timezone.getID(), new TimeZone(updateDefinition(timezone.getVTimeZone()))); } else { timezones.put(timezone.getID(), timezone); } }
/** * {@inheritDoc} */ public final void register(final TimeZone timezone, boolean update) { if (update) { // load any available updates for the timezone.. timezones.put(timezone.getID(), new TimeZone(updateDefinition(timezone.getVTimeZone()))); } else { timezones.put(timezone.getID(), timezone); } }
/** * Gets timezone id. * @param date The date. * @return The id. */ private String getTzId(Date date) { if(date instanceof DateTime) { DateTime dt = (DateTime) date; if (dt.getTimeZone()!=null) { return dt.getTimeZone().getID(); } } return null; }
/** * Gets timezone id. * @param date The date. * @return The id. */ private String getTzId(Date date) { if(date instanceof DateTime) { DateTime dt = (DateTime) date; if (dt.getTimeZone()!=null) { return dt.getTimeZone().getID(); } } return null; }
private void copyDateProperty(ContentValues c, String dbName, String dbTzName, DateProperty date) { if (dbName != null && date.getDate() != null) { c.put(dbName, date.getDate().getTime()); // ms since epoc in GMT if (dbTzName != null) { if (date.isUtc() || date.getTimeZone() == null) c.put(dbTzName, "UTC"); else c.put(dbTzName, date.getTimeZone().getID()); } } }
/** * Set the timezone to use when converting floating times to * UTC. Only used if isUTC is set to true. * * @param timezone The timezone. */ public void setTimezone(TimeZone timezone) { if(timezone != null ){ this.timezone = TimeZoneRegistryFactory.getInstance().createRegistry().getTimeZone(timezone.getID()); } }
/** * Set the timezone to use when converting floating times to * UTC. Only used if isUTC is set to true. * * @param timezone The timezone. */ public void setTimezone(TimeZone timezone) { if(timezone != null ){ this.timezone = TimeZoneRegistryFactory.getInstance().createRegistry().getTimeZone(timezone.getID()); } }
private void updateTimeZone(Property property, TimeZone timezone) { try { ((DateProperty) property).setTimeZone(timezone); } catch (ClassCastException e) { try { ((DateListProperty) property).setTimeZone(timezone); } catch (ClassCastException e2) { if (CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING)) { Logger log = LoggerFactory.getLogger(CalendarBuilder.class); log.warn("Error setting timezone [" + timezone.getID() + "] on property [" + property.getName() + "]", e); } else { throw e2; } } } }
private void updateTimeZone(Property property, TimeZone timezone) { try { ((DateProperty) property).setTimeZone(timezone); } catch (ClassCastException e) { try { ((DateListProperty) property).setTimeZone(timezone); } catch (ClassCastException e2) { if (CompatibilityHints.isHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING)) { Logger log = LoggerFactory.getLogger(CalendarBuilder.class); log.warn("Error setting timezone [" + timezone.getID() + "] on property [" + property.getName() + "]", e); } else { throw e2; } } } }
/** * @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); }
public String getName() { if (timezone != null) { return super.getName() + " [" + timezone.getID() + "]"; } return super.getName(); }
/** * Constructs an <code>ICalDate</code> from an iCalendar date * list. Date lists cannot be anytime. * @param dates The date list. * @throws UnknownTimeZoneException - if something is wrong this exception is thrown. */ public ICalDate(DateList dates) throws UnknownTimeZoneException { value = dates.getType(); tz = dates.getTimeZone(); if (tz != null) { String origId = tz.getID(); tz = tzTranslator.translateToOlsonTz(tz); if (tz == null) { throw new UnknownTimeZoneException(origId); } String id = tz.getVTimeZone().getProperties(). getProperty(Property.TZID).getValue(); tzid = new TzId(id); } text = dates.toString(); this.dates = dates; }