Skip to content Skip to footer navigation

Is Leap Year Modifier

Returns true if date is in a leap year. Try and find a regular use for this one, we dare you.

date: June 19 2012
another_date: June 19 2013
{{ if date | is_leap_year }}
{{ if another_date | is_leap_year }}
@if (Statamic::modify($date)->isLeapYear()->fetch()) ... @endif
@if (Statamic::modify($another_date)->isLeapYear()->fetch()) ... @endif
true
false
Warning!

Date modifiers preserve the date value's timezone by default. Dated entries use UTC. Enable localize_dates_in_modifiers in config/statamic/system.php to convert dates to your display timezone before applying modifiers.

Please refer to our Timezones guide for more information.

A troll pointing a teaching stick