Time conversion to day of week fails

Hello,

I use caldav to pull calendar items from Google, this works. Then I would like to change the datetime returned to transform to day of week (Monday, Tuesday ext…). This however this does not get applied.

calendar.items:

String      Calendar_home_Event1         "Event [%s]"        <calendar>  { caldavPersonal="calendar:'sabine' type:'UPCOMING' eventNr:'1' value:'NAME'" }
String      Calendar_home_Place1         "Place [%s]"        <calendar>  { caldavPersonal="calendar:'sabine' type:'UPCOMING' eventNr:'1' value:'PLACE'" }
DateTime	Calendar_home_Start_Day1     "[%1$tA]"   <calendar>  { caldavPersonal="calendar:'sabine' type:'UPCOMING' eventNr:'1' value:'START'" }
DateTime	Calendar_home_Start_Month1   "[%1$tB]"  <calendar>  { caldavPersonal="calendar:'sabine' type:'UPCOMING' eventNr:'1' value:'START'" }
DateTime    Calendar_home_Start_Time1    "Start Time [%s]"   <calendar>  { caldavPersonal="calendar:'sabine' type:'UPCOMING' eventNr:'1' value:'START'" }
DateTime    Calendar_home_End_Time1      "End Time [%s]"     <calendar>  { caldavPersonal="calendar:'sabine' type:'UPCOMING' eventNr:'1' value:'END'" }

*edit: add the missing brackets.

In HabPanel, I create a dummy and select Calendar_home_Start_Day1. This is returned:
2018-01-24T08:30:00.000+0000

It’s an ISO 8601 format, which should be supported by the Formatter class.

Any idea what I’m doing wrong?

Bastiaan

I have found log errors regarding this issue. Looks like the Formatter class can’t handle the reformat of the ISO 8601.

2018-01-22 20:59:36.983 [WARN ] [.core.transform.TransformationHelper] - Cannot format state '2018-01-23T19:00:00.000+0000' to format '%1$tA': A != java.lang.String
2018-01-22 20:59:36.998 [WARN ] [.core.transform.TransformationHelper] - Cannot format state '2018-01-23T19:00:00.000+0000' to format '%1$tB': B != java.lang.String

I think you’re missing a bracket in each of the DateTime lines:

DateTime	Calendar_home_Start_Day1     "[%1$tA]"   <calendar>  { caldavPersonal="calendar:'sabine' type:'UPCOMING' eventNr:'1' value:'START'" }

Hi yes, you are right. However I had corrected this prior to posting, but did not corrected it here. But thanks for pointing it out.

I think the Formatter can’t handle ISO 8601, I’m finding simular posts on the web. Is there a way to manipulate the string prior to the Formatter?