whereDate method
CoffeeRequestGet<T>
whereDate(
- dynamic type,
- WhereOperator operator,
- DateTime date, {
- String filterBy = 'full-date',
Creates a filter for date searches.
type
: The property to filter by, either a String or a Function.
operator
: The comparison operator to use ('==', '!=', '<=', '<', '>=', '>').
date
: The date value to compare.
filterBy
: Specifies the components of the date to filter by ('day', 'month', 'year', 'day-month', 'day-year', 'month-year', 'day-month-year', 'full-date'). Default is 'full-date'.
Returns a CoffeeRequestGet<T> configured for date searches.
Usage Example
whereDate('createdAt', WhereOperator.equal, DateTime.now(), 'day');
whereDate((Model model) => model.createdAt, WhereOperator.equal, DateTime(2022, 10, 27), 'day');
Implementation
CoffeeRequestGet<T> whereDate(dynamic type, WhereOperator operator, DateTime date, {
String filterBy = 'full-date'
}) {
_queryParameters.add(cqf.whereDate(type, operator, date, filterBy: filterBy));
return this;
}