I can't seem to be able to do any comparisons on the formatted event dates within the Solspace calendar. For example, in the following piece of code I'm trying to modify the mini-calendar example from the calendar docs (https://solspace.com/expressionengine/calendar/docs/month/) not to show links to any Mondays (because the company I work for is closed on Mondays):
<div>
{if calendar:day_in_current_month} {!-- Only show day number for current month --}
{if calendar:day_total_events && ('{calendar:day_date format="%D"}' != 'Mon')} {!-- Link to the day if there's events for it, if it's not a Monday --}
<a href="{path='/visit/calendar/day'}/{calendar:day_date format='%Y/%m/%d'}/" id="day-link-{calendar:day_date format='%Y-%m-%d'}">
{/if}
{calendar:day_date format="%j"}
{if calendar:day_total_events && ('{calendar:day_date format="%D"}' != 'Mon')}
</a>
{/if}
{if:else} {!-- Don't show day number if day is not in current month --}
<strong> </strong>
{/if}
</div>
The != 'Mon' comparison fails on all entries, including the ones occurring on Mondays.
Similarly, on another page I need to not show any events within a specific category during the winter months, as follows:
{if !( ( ('{category_name}' == 'X') || ('{category_name}' == 'Y') ) && ( ({calendar:month_date format='%n'} < 11) || ({calendar:month_date format='%n'} > 3) ) )}
<li>
<a id="category-link-{category_url_title}" href="/calendar/category/{category_url_title}">{category_name}</a>
</li>
{/if}
This doesn't seem to work either -- i.e. all categories get displayed all the time.
Can anyone point out what I'm doing wrong in either or both of these cases?
Thanks!
Misha