Is Before Modifier
Returns true
if a date variable is before another date. That second date can be the name of another variable or a literal date string.
start_date: January 17 2015
end_date: December 1 2015
{{ if end_date | is_before($start_date) }}
{{ if start_date | is_before(2014) }}
{{ if start_date | is_before($end_date) }}
@if (Statamic::modify($end_date)->isBefore($start_date)->fetch()) @endif
@if (Statamic::modify($start_date)->isBefore(2014)->fetch()) @endif
@if (Statamic::modify($start_date)->isBefore($end_date)->fetch()) @endif
false
false
true
Warning!
By default, when using a modifier on a date variable, it will be operating on the UTC date rather than the localized date.
Please refer to our Timezones guide for more information.

Docs Feedback
Submit improvements, related content, or suggestions through Github.
Betterify this page