0

We are using Matrix to make a company calendar. We would like to enter the events into a matrix table one month at a time but display only the current day's events. We are trying to search a matrix date field and check if it matches the current day.

{schedule search:date="={current_time}" sort="asc"}

Has anyone done this before? Suggestions/help is much appreciated.

Thanks

1

The search condition would never match as {date} and {current_time} both output the UNIX Time (number of seconds since 1 January 1970). You would need to have IF condition with MATRIX variable tag like:

{schedule orderby="date" sort="asc"}

{if "{date format='%Y%m%d'}" == "{current_time format='%Y%m%d'}"}

{!-- Put other tags here --}

{/if}

{/schedule}
| improve this answer | |
  • 2
    If you have any conditionals within the display of your events from the matrix field, you may want to wrap the outer conditional with an early parsing conditional add-on, such as croxton's ifelse or switchee. But you can certainly still use the conditional without using such an add-on. – Jean St-Amand Aug 27 '13 at 13:06
  • Thank you this worked perfect for us. Now another question: Is there a way to display the events by week using a similar concept? And could we display tomorrow using the same concept? – DigitalDesigns Aug 27 '13 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.