Skip to content Skip to footer navigation

Is Between Modifier

Returns true if a date variable is between two other dates. Those dates can be the name of other variables or literal date strings.

date: June 19 2012
start_date: June 1 2012
end_date: July 1 2012
{{ if date | is_between($start_date, $end_date) }}
@if (Statamic::modify($date)->isBetween([$start_date, $end_date])->fetch()) @endif
true
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