google_calendar module: Inject is_current into format event
Usecase: I want to show start_dat for upcoming events and end_time for ongoing events. Example usage:
google_calendar {
format = "{events}"
events_within_hours = 48
format_event = "[\?color=lime {summary}] [\?if=is_current until {end_time}][\?if=!is_current {start_time}] {format_timer}"
format_time = "%a %H:%M"
format_timer = "\?color=time ([\?if=!is_current in ][\?if=days {days}d ][\?if=hours {hours}h ][\?if=minutes {minutes}m][\?if=is_current \ left])"
}
I have added documentation for the new placeholder. I found out that is_current was not documented for format_event either, so I added documentation for that too (it is not in format_notification so that's why I needed to add it separately).
todayplaceholder sounds better.
Sorry, I do not know what you mean by this. 😁
... know what you mean...
I'm wondering if this is a good event placeholder name or if there is a more fitting one... is_current, current, today (probably not, now I have looked into it a bit more), active, ongoing, etc. I'm leaning on active right now. Idk.
... know what you mean...
I'm wondering if this is a good event placeholder name or if there is a more fitting one...
is_current,current,today(probably not, now I have looked into it a bit more),active,ongoing, etc. I'm leaning onactiveright now. Idk.
I am fine with changing it to active. I only called it is_current, because that's what the existing placeholder was named. :)
Although if someone depended on the current placeholder name (like the default format_event does), changing the name will be a breaking change. And I suppose it's better if the placeholders have the same name.
We can leave is_current in place for only safeformatted format_timer and update the docs mentioning active.
Hmm, okay, so:
- My new placeholder for
format_eventis now calledactive. - The
is_currentplaceholder forformat_timerstays in place for backwards compatibility. - I have added documentation for both of those.
- I have also renamed the
is_currentvariable to be calledevent_active. Seems like a better name, but I can remove that.
Current situation:
- both
format_timerandformat_eventhave theactiveplaceholder -
format_timerhas theis_currentplaceholder for compatibllity - the default
format_timernow usesactiveinstead ofis_current - the documentation only speaks about
active - the variable renaming is still in place