Open carcohcal opened 2 years ago
Thanks for the early feedback.
Can you confirm which version of ical4j you are using? The tests are currently run with ical4j v3.1.1.
Thanks for the early feedback.
Can you confirm which version of ical4j you are using? The tests are currently run with ical4j v3.1.1.
Hi,
I'm using gradle with the following versions:
'org.mnode.ical4j:ical4j:4.0.0-alpha9' 'org.mnode.ical4j:ical4j-serializer:0.1.6'
Unfortunately ical4j v4 has a number of incompatible API changes that are not yet supported in ical4j-serializer. Once the final release of v4 is announced we will look to transition other libraries to the new API.
I change ical API version but still have some issues.
I use the ical -> json function to serialize my calendar:
private String ICALaJSON(Calendar calendar) throws JsonProcessingException {
SimpleModule module = new SimpleModule();
module.addSerializer(Calendar.class, new JCalSerializer((Calendar.class)));
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(module);
String serialized = mapper.writeValueAsString(calendar);
System.out.println(serialized);
return serialized;
}
For testing that serialize string is passed to the the json -> ical conversion function. I have the following function:
private void JSONaIcal(String json) throws JsonMappingException, JsonProcessingException {
SimpleModule module = new SimpleModule();
module.addDeserializer(Calendar.class, new JCalMapper(Calendar.class));
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(module);
Calendar calendar = mapper.readValue(json, Calendar.class);
log.info("CONTROL");
}
But the following error occurs:
Caught DateTimeException: Text '2021-12-16T19:20:59Z' could not be parsed, unparsed text found at index 19
It is related to [["dtstamp",{},"date-time","2021-12-16T19:20:59Z"]
Thanks
Hi,
I'm trying to use the jCal JSON example but it isn't working:
The first issue I encounter is the need to set an entry parameter in the JCalSerializer.
I added Calendar.class and compiles OK but while executing the following exception occurs in this line
String serialized = mapper.writeValueAsString(calendar);
I check the calendar and it has properties and components. I don't know if I'm doing something wrong or there is a bug.
Thanks