I dry o get from a calendar item only 2 parts of the string into a new item.
i have the caldav items:
String CalDav_MuellkalName1 “Mülltonne [%s]” { caldavPersonal=“calendar:Muellkal type:EVENT eventNr:1 value:NAME” }
DateTime CalDav_MuellkalDate1 “Datum der Abholung [%1$td.%1$tm.%1$tY]” { caldavPersonal=“calendar:Muellkal type:EVENT eventNr:1 value:START” }
with the result
CalDav_MuellkalName1: "blaue Tonne"
CalDav_MuellkalDate1: “17.11.2016”
Now i want 1 item with the data "blaue Tonne -> 17.11.2016"
How can i do this?
Create a Rule that triggers on update to either of those two Items and postUpdate to a Third Item.
String CalDav_MuellMerged1 ...
rule "Update CalDav_MuellMerged1"
when
Item CalDav_MuellkalName1 received update or
Item CalDav_MuellkalDate1 received update
then
CalDav_MuellMerged1.postUpdate(CalDav_MuellkalName1.state.toString + " -> " + CalDav_MuellkalDate1.state.toString)
end
The function to put it into 1 field works, Thanks.
But i cannot get only the date(17.11.2016) from the item “CalDav_MuellkalDate1.state.toString”, i tried like CalDav_MuellkalDate1.state.toString(“dd.MM.yyyy”) but i dont work. I tried CalDav_MuellkalDate1.state.toString(“HH:mm”) too, but it dont work.
I get always these string: