viewpoint 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/model/generic_folder.rb +11 -4
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.1.6
@@ -214,20 +214,27 @@ module Viewpoint
214
214
 
215
215
  def todays_items
216
216
  #opts = {:query_string => ["Received:today"]}
217
- items_since(Date.today.to_datetime)
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'}, :field_uRI_or_constant =>{:constant => {:value=>date_time}}}}}
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 => {:field_uRI => {:field_uRI=>'item:DateTimeReceived'},:field_uRI_or_constant=>{:constant => {:value =>start_date}}}},
230
- {:is_less_than_or_equal_to => {:field_uRI => {:field_uRI=>'item:DateTimeReceived'},:field_uRI_or_constant=>{:constant => {:value =>end_date}}}}
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
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 5
9
- version: 0.1.5
8
+ - 6
9
+ version: 0.1.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Dan Wanek