Changeset 273
- Timestamp:
- 03/09/06 14:08:02
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/appcommon/src/org/bedework/appcommon/TimeView.java
r251 r273 284 284 String end = endDt.getDate(); 285 285 286 debugMsg("Did UTC stuff in " + (System.currentTimeMillis() - millis)); 286 if (debug) { 287 debugMsg("Did UTC stuff in " + (System.currentTimeMillis() - millis)); 288 } 287 289 288 290 //if (debug) { trunk/calendar3/calFacade/src/org/bedework/calfacade/CalFacadeUtil.java
r27 r273 65 65 import java.net.URLEncoder; 66 66 import java.text.DateFormat; 67 import java.text.ParseException;68 67 import java.text.SimpleDateFormat; 69 68 import java.util.ArrayList; … … 125 124 */ 126 125 public static String isoDate(Date val) { 127 return isoDateFormat.format(val); 126 synchronized (isoDateFormat) { 127 return isoDateFormat.format(val); 128 } 128 129 } 129 130 … … 134 135 */ 135 136 public static String isoDateTime(Date val) { 136 return isoDateTimeFormat.format(val); 137 synchronized (isoDateTimeFormat) { 138 return isoDateTimeFormat.format(val); 139 } 137 140 } 138 141 … … 143 146 */ 144 147 public static String isoDateTimeUTC(Date val) { 145 return isoDateTimeUTCFormat.format(val); 148 synchronized (isoDateTimeUTCFormat) { 149 return isoDateTimeUTCFormat.format(val); 150 } 146 151 } 147 152 … … 154 159 public static Date fromISODate(String val) throws CalFacadeException { 155 160 try { 156 return isoDateFormat.parse(val); 161 synchronized (isoDateFormat) { 162 return isoDateFormat.parse(val); 163 } 157 164 } catch (Throwable t) { 158 165 throw new CalFacadeBadDateException(); … … 168 175 public static Date fromISODateTime(String val) throws CalFacadeException { 169 176 try { 170 return isoDateTimeFormat.parse(val); 177 synchronized (isoDateTimeFormat) { 178 return isoDateTimeFormat.parse(val); 179 } 180 } catch (Throwable t) { 181 throw new CalFacadeBadDateException(); 182 } 183 } 184 185 /** Get Date from "yyyyMMddThhmmssZ" 186 * 187 * @param val String "yyyyMMddThhmmssZ" 188 * @return Date 189 * @throws CalFacadeException 190 */ 191 public static Date fromISODateTimeUTC(String val) throws CalFacadeException { 192 try { 193 synchronized (isoDateTimeUTCFormat) { 194 return isoDateTimeUTCFormat.parse(val); 195 } 171 196 } catch (Throwable t) { 172 197 throw new CalFacadeBadDateException(); … … 182 207 public static boolean isISODate(String val) throws CalFacadeException { 183 208 try { 184 isoDateFormat.parse(val);209 fromISODate(val); 185 210 return true; 186 211 } catch (Throwable t) { … … 197 222 public static boolean isISODateTimeUTC(String val) throws CalFacadeException { 198 223 try { 199 isoDateTimeUTCFormat.parse(val);224 fromISODateTimeUTC(val); 200 225 return true; 201 226 } catch (Throwable t) { … … 212 237 public static boolean isISODateTime(String val) throws CalFacadeException { 213 238 try { 214 isoDateTimeFormat.parse(val);239 fromISODateTime(val); 215 240 return true; 216 241 } catch (Throwable t) { … … 231 256 try { 232 257 if (val.getDateType()) { 233 return isoDateFormat.parse(dtval);258 return fromISODate(dtval); 234 259 } 235 260 236 261 if (dtval.endsWith("Z")) { 237 return isoDateTimeUTCFormat.parse(dtval);238 } 239 240 return isoDateTimeFormat.parse(dtval);262 return fromISODateTimeUTC(dtval); 263 } 264 265 return fromISODateTime(dtval); 241 266 } catch (Throwable t) { 242 267 throw new CalFacadeBadDateException(); … … 300 325 301 326 try { 302 dt = isoDateTimeUTCFormat.parse(val);327 dt = fromISODateTimeUTC(val); 303 328 UTC = true; 304 } catch ( ParseException pe1) {329 } catch (CalFacadeBadDateException bde1) { 305 330 try { 306 dt = isoDateTimeFormat.parse(val);307 } catch ( ParseException pe2) {331 dt = fromISODateTime(val); 332 } catch (CalFacadeBadDateException bde2) { 308 333 try { 309 dt = isoDateFormat.parse(val);334 dt = fromISODate(val); 310 335 dateOnly = true; 336 } catch (CalFacadeException ce) { 337 throw ce; 311 338 } catch (Throwable t) { 312 339 throw new CalFacadeException(t); trunk/calendar3/webcommon/src/org/bedework/webcommon/EntityDates.java
r27 r273 55 55 package org.bedework.webcommon; 56 56 57 import java.io.Serializable; 58 57 59 import org.bedework.appcommon.CalendarInfo; 58 60 import org.bedework.calsvci.CalSvcI; … … 66 68 * This is the base class for entity specific classes. 67 69 */ 68 public class EntityDates {70 public class EntityDates implements Serializable { 69 71 protected boolean debug; 70 72
