viewpoint 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/model/generic_folder.rb +11 -4
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.6
|
data/lib/model/generic_folder.rb
CHANGED
@@ -214,20 +214,27 @@ module Viewpoint
|
|
214
214
|
|
215
215
|
def todays_items
|
216
216
|
#opts = {:query_string => ["Received:today"]}
|
217
|
-
|
217
|
+
#This is a bit convoluted for pre-1.9.x ruby versions that don't support to_datetime
|
218
|
+
items_since(DateTime.parse(Date.today.to_s))
|
218
219
|
end
|
219
220
|
|
220
221
|
def items_since(date_time)
|
221
222
|
restr = {:restriction =>
|
222
223
|
{:is_greater_than_or_equal_to =>
|
223
|
-
{:field_uRI => {:field_uRI=>'item:DateTimeReceived'},
|
224
|
+
[{:field_uRI => {:field_uRI=>'item:DateTimeReceived'}},
|
225
|
+
{:field_uRI_or_constant =>{:constant => {:value=>date_time}}}]
|
226
|
+
}}
|
224
227
|
find_items(restr)
|
225
228
|
end
|
226
229
|
|
227
230
|
def items_between(start_date, end_date)
|
228
231
|
restr = {:restriction => {:and => [
|
229
|
-
{:is_greater_than_or_equal_to =>
|
230
|
-
|
232
|
+
{:is_greater_than_or_equal_to =>
|
233
|
+
[{:field_uRI => {:field_uRI=>'item:DateTimeReceived'}},
|
234
|
+
{:field_uRI_or_constant=>{:constant => {:value =>start_date}}}]},
|
235
|
+
{:is_less_than_or_equal_to =>
|
236
|
+
[{:field_uRI => {:field_uRI=>'item:DateTimeReceived'}},
|
237
|
+
{:field_uRI_or_constant=>{:constant => {:value =>end_date}}}]}
|
231
238
|
]}}
|
232
239
|
find_items(restr)
|
233
240
|
end
|