# Function dateTo

dateTo(level, to): Filter

Creates a filter to isolate items up until and including the given date and level.

# Parameters

Parameter Type Description
level LevelAttribute Date LevelAttribute to filter on
to string | Date Date or string representing the last member to filter to

# Returns

Filter

A filter instance

# Example

Filter for items where the date is from the year 2010 or earlier in the Sample ECommerce data model.

filterFactory.dateTo(DM.Commerce.Date.Years, '2010-01')