XF 2.3 Display widget on specific date

PrettyPixels

Well-known member
Is it possible to display a widget only on a specific date? For example, if I wanted a widget only to show on Christmas Day, December 25th, then automatically hide again on the 26th?

If so, what conditional would I use?
 
I would think a display condition on the widget of:
PHP:
date($xf.time, 'j/n') == '25/12'
Would work and be moderately clear when you come back to it in years to come. Please see the PHP manual for the date/time format string details, you'd need to edit that if you wanted a specific year for instance. j/n is the day (j) without leading zeros followed by a forward slash (/) followed by the month (n) without leading zeros.
 
Back
Top Bottom