@@ -9,27 +9,61 @@ public class DateFilter : SinglePropertyFilter
99 {
1010 public Condition Date { get ; set ; }
1111
12+ public DateFilter (
13+ string propertyName ,
14+ DateTime ? equal = null ,
15+ DateTime ? before = null ,
16+ DateTime ? after = null ,
17+ DateTime ? onOrBefore = null ,
18+ DateTime ? onOrAfter = null ,
19+ Dictionary < string , object > pastWeek = null ,
20+ Dictionary < string , object > pastMonth = null ,
21+ Dictionary < string , object > pastYear = null ,
22+ Dictionary < string , object > nextWeek = null ,
23+ Dictionary < string , object > nextMonth = null ,
24+ Dictionary < string , object > nextYear = null ,
25+ bool ? isEmpty = null ,
26+ bool ? isNotEmpty = null )
27+ {
28+ Property = propertyName ;
29+ Date = new Condition (
30+ equal : equal ,
31+ before : before ,
32+ after : after ,
33+ onOrBefore : onOrBefore ,
34+ onOrAfter : onOrAfter ,
35+ pastWeek : pastWeek ,
36+ pastMonth : pastMonth ,
37+ pastYear : pastYear ,
38+ nextWeek : nextWeek ,
39+ nextMonth : nextMonth ,
40+ nextYear : nextYear ,
41+ isEmpty : isEmpty ,
42+ isNotEmpty : isNotEmpty
43+ ) ;
44+ }
45+
1246 public class Condition
1347 {
1448 [ JsonProperty ( "equals" ) ]
1549 [ JsonConverter ( typeof ( IsoDateTimeConverter ) ) ]
16- public Nullable < DateTime > Equal { get ; set ; }
50+ public DateTime ? Equal { get ; set ; }
1751
1852 [ JsonProperty ( "before" ) ]
1953 [ JsonConverter ( typeof ( IsoDateTimeConverter ) ) ]
20- public Nullable < DateTime > Before { get ; set ; }
54+ public DateTime ? Before { get ; set ; }
2155
2256 [ JsonProperty ( "after" ) ]
2357 [ JsonConverter ( typeof ( IsoDateTimeConverter ) ) ]
24- public Nullable < DateTime > After { get ; set ; }
58+ public DateTime ? After { get ; set ; }
2559
2660 [ JsonProperty ( "on_or_before" ) ]
2761 [ JsonConverter ( typeof ( IsoDateTimeConverter ) ) ]
28- public Nullable < DateTime > OnOrBefore { get ; set ; }
62+ public DateTime ? OnOrBefore { get ; set ; }
2963
3064 [ JsonProperty ( "on_or_after" ) ]
3165 [ JsonConverter ( typeof ( IsoDateTimeConverter ) ) ]
32- public Nullable < DateTime > OnOrAfter { get ; set ; }
66+ public DateTime ? OnOrAfter { get ; set ; }
3367
3468 [ JsonProperty ( "past_week" ) ]
3569 public Dictionary < string , object > PastWeek { get ; set ; }
@@ -50,10 +84,40 @@ public class Condition
5084 public Dictionary < string , object > NextYear { get ; set ; }
5185
5286 [ JsonProperty ( "is_empty" ) ]
53- public Nullable < bool > IsEmpty { get ; set ; }
87+ public bool ? IsEmpty { get ; set ; }
5488
5589 [ JsonProperty ( "is_not_empty" ) ]
56- public Nullable < bool > IsNotEmpty { get ; set ; }
90+ public bool ? IsNotEmpty { get ; set ; }
91+
92+ public Condition (
93+ DateTime ? equal = null ,
94+ DateTime ? before = null ,
95+ DateTime ? after = null ,
96+ DateTime ? onOrBefore = null ,
97+ DateTime ? onOrAfter = null ,
98+ Dictionary < string , object > pastWeek = null ,
99+ Dictionary < string , object > pastMonth = null ,
100+ Dictionary < string , object > pastYear = null ,
101+ Dictionary < string , object > nextWeek = null ,
102+ Dictionary < string , object > nextMonth = null ,
103+ Dictionary < string , object > nextYear = null ,
104+ bool ? isEmpty = null ,
105+ bool ? isNotEmpty = null )
106+ {
107+ Equal = equal ;
108+ Before = before ;
109+ After = after ;
110+ OnOrBefore = onOrBefore ;
111+ OnOrAfter = onOrAfter ;
112+ PastWeek = pastWeek ;
113+ PastMonth = pastMonth ;
114+ PastYear = pastYear ;
115+ NextWeek = nextWeek ;
116+ NextMonth = nextMonth ;
117+ NextYear = nextYear ;
118+ IsEmpty = isEmpty ;
119+ IsNotEmpty = isNotEmpty ;
120+ }
57121 }
58122 }
59123}
0 commit comments