On Saturday, May 15, 2021 at 12:31:44 PM UTC-7 jacque...@gmail.com wrote: > I'm adopting Eric's TiddlyTools/Time/Calendar. Thanks to him. > I have a problem when conflicting colors happen for a same day. How to > force priority on the color I'd want ? > > *An instance :* > > - I have a timeline for team members absences, coded "OldLace". Fred > is not available Monday and Tuesday next. > - I decide to settle a meeting, even without Fred that monday. Team > meeting are "LightGreen" coded events. > - When I publish the calendar, I want Monday color to be LightGreen > for everybody, but it remains OldLace. > > When there are multiple events for a given date, they are *sorted by the title of the EventList or Timeline* that defines them and the *date color is determined by the first event* in the resulting list.
Here's the code from the showDay() macro that does the work: <$wikify name="colors" text="<$list filter=<<todays_events>>>{{{ [<currentTiddler>split[;]nth[1]get[eventcolor]] }}} </$list>"> <$set name="eventsbg" filter="[enlist<colors>first[]addprefix[background:]addsuffix[;]else<eventsbg>]"> If you have a Timeline named "Absences" (using the OldLace color) and an EventList named "Meetings" (using the LightGreen color), then the OldLace color will be applied, since "Absences" comes before "Meetings", alphabetically. The only way to influence the color that is used is to rename the Timeline or the EventList so that the event color that you want to have priority occurs first in the sorted list of events. For example, you could rename "Meetings" to "1Meetings" so it comes before "Absences", or rename "Absences" to "ZAbsences" so it comes after "Meetings". However, renaming a Timeline can be quite a nuisance, because the name of the Timeline is also used to tag each individual tiddler that belongs to that Timeline. Thus, you would have to change not only the name of the "Absences" Timeline tiddler itself, but also update the corresponding "Absences" tag on every individual tiddler belonging to that Timeline. Fortunately, renaming an EventList is much easier than renaming a Timeline, since there is only one tiddler involved with no extra tagging issues. Note that even if you rename the "Meetings" EventList tiddler to "1Meetings", you can also give that tiddler a caption of "Meetings", so that the leading "1" won't appear in the Calendar interface. When I wrote this part of the Calendar, I had considered adding extra code to address this issue by allowing explicit specification of the color order, but all the implementations I could think of would have added considerable complexity and processing overhead to the Calendar rendering logic. I hope this explanation isn't too confusing. Let me know how it goes... -e > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/6de7be3e-24c1-4ccf-8889-2cf063c6f099n%40googlegroups.com.