public static Date getStashCreationTimeStamp(String stashStartTime) throws ParseException { return new ISO8601DateFormat().parse(stashStartTime); }
public static Date getStashCreationTimeStamp(String stashStartTime) throws ParseException { return new ISO8601DateFormat().parse(stashStartTime); }
public static Date parse(String dateString) { try { return new ISO8601DateFormat().parse(dateString); } catch (ParseException e) { return throwUnchecked(e, Date.class); } }
@Override public Object apply(String context, Options options) throws IOException { String format = options.hash("format", null); try { return format == null ? new ISO8601DateFormat().parse(context) : new SimpleDateFormat(format).parse(context); } catch (ParseException e) { return Exceptions.throwUnchecked(e, Object.class); } } }
public static Date toDate(QueryParameter parameter) { try { return parameter.isPresent() ? new ISO8601DateFormat().parse(parameter.firstValue()) : null; } catch (ParseException e) { throw new IllegalArgumentException(parameter.firstValue() + " is not a valid ISO8601 date"); } } }
@Override public Object getVariableValue(EngineRestVariable result) { if (result.getValue() != null) { if (!(result.getValue() instanceof String)) { throw new FlowableIllegalArgumentException("Converter can only convert string to date"); } try { return isoFormatter.parse((String) result.getValue()); } catch (ParseException e) { throw new FlowableIllegalArgumentException("The given variable value is not a date: '" + result.getValue() + "'", e); } } return null; }
@Override public Object getVariableValue(RestVariable result) { if (result.getValue() != null) { if (!(result.getValue() instanceof String)) { throw new FlowableIllegalArgumentException("Converter can only convert string to date"); } try { return isoFormatter.parse((String) result.getValue()); } catch (ParseException e) { throw new FlowableIllegalArgumentException("The given variable value is not a date: '" + result.getValue() + "'", e); } } return null; }
@Override public Object getVariableValue(RestVariable result) { if (result.getValue() != null) { if (!(result.getValue() instanceof String)) { throw new ActivitiIllegalArgumentException("Converter can only convert string to date"); } try { return isoFormatter.parse((String) result.getValue()); } catch (ParseException e) { throw new ActivitiIllegalArgumentException("The given variable value is not a date: '" + result.getValue() + "'", e); } } return null; }