To create an All Day event today, set start_date to today’s date and end_date to tomorrow’s date. In other words, there’s no time specified, just the date, and the end date must be the next day.
Hi
I am trying to do something very similar - a button to add a calendar event to a local calendar. Your post was helpful in getting so far, but I am struggling with data types in the template.
I have created an input.select drop down helper for the summary field and an input. date for the start date,
I am passing these from a button to a script as fields (code below).
Then I am trying to calculate the end date (start day plus 1) ready to create the calendar event.
I have looked at many forum posts, tried many combinations of template syntax and data typing and now feel too close to the problem, so it is probably something simple (I hope) that I have missed. If you can make a suggestion it would be most helpful please.
Similar to some of the previous errors I have seen. I think I understand your logic on line 21 to convert the variable to and then back from date type.
My primitive understanding suggests an issue with the first item of data under sequence, but I may well be wrong. (I tried without states and got the same) (I guess it could also be something missing elsewhere that makes the first item wrong - hence my maze-like journey so far.)
Does the [:10] slice the front/back from the string to give a date (without time)? The helper was set up to gather just a date so do I need this?
I tried adding a dummy 3rd field/parameter called remind_end, in case it was expecting it, but it made no difference.
Thanks - that is great - and apologies I probably should have spotted that.
It has now added an event to the calendar (hooray!), though it is not showing in the same way as one entered manually on the sidebar Calendar page.
The manual one was entered by ticking ‘all day’ and I get the solid block colour for the day 6th Feb, whereas by entering start and end times there is only a timed entry style - 5th Feb.
Not the end of the world, but do you know if there is a way to enter an event as all day? (I thought the calendar might work that out automatically) Cannot see it on the calendar doc page, but may have missed it.
Incidental question - Local calendar has allocated white text on yellow (ugh!) for the calendar - do you know where this is configured? (I cannot find how to get to the properties of the calendar itself - no 3 dot menu nor any setting in the entity as far as I can see)
Thanks again.
According to the documentation, you use the start_date and end_date options to specify whole day events (not the start_date_time and end_date_time options).
start_date
The date the whole day event should start.
Some discussion around whether it involves assigning colours to all entities or just some kind of calendar attribute. I will try and use some kind of card to display what I need and hope the theme or card-mod maybe will help out.