slimtimer4r 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/History.txt +4 -0
  2. data/lib/slimtimer4r.rb +7 -3
  3. metadata +2 -2
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.2.2 / 2008-01-15
2
+
3
+ * Fix the list_entries method to properly set the beginning time to midnight if a Date is passed in.
4
+
1
5
  == 0.2.1 / 2008-01-10
2
6
 
3
7
  * RDoc enhancements
data/lib/slimtimer4r.rb CHANGED
@@ -2,7 +2,7 @@ require 'yaml'
2
2
  require 'net/http'
3
3
 
4
4
  class SlimTimer
5
- VERSION = '0.2.1'
5
+ VERSION = '0.2.2'
6
6
 
7
7
  #
8
8
  # The Record class is used to encapsulate the data returned from the SlimTimer API. This allows access
@@ -118,11 +118,15 @@ class SlimTimer
118
118
  # it will append a time of 23:59:59 to the request. Default
119
119
  # is +nil+, meaning there is no end range.
120
120
  def list_timeentries(range_start=nil, range_end=nil)
121
- range_start = range_start.strftime("%Y-%m-%dT%H:%M:%SZ") unless range_start.nil?
121
+ if range_start.is_a?(Date)
122
+ range_start = range_start.strftime("%Y-%m-%dT00:00:00Z")
123
+ else
124
+ range_start = range_start.strftime("%Y-%m-%dT%H:%M:%SZ") unless range_start.nil?
125
+ end
122
126
  if range_end.is_a?(Date)
123
127
  range_end = range_end.strftime("%Y-%m-%dT23:59:59Z")
124
128
  else
125
- range_end = range_end.strftime("%Y-%m-%dT%H:%M:%SZ") unless range_end.nil?
129
+ range_end = range_end.strftime("%Y-%m-%dT%H:%M:%SZ") unless range_end.nil?
126
130
  end
127
131
  request("get", "#{@user_id}/time_entries?api_key=#{@api_key}&access_token=#{@access_token}&range_start=#{range_start}&range_end=#{range_end}", "TimeEntries")
128
132
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slimtimer4r
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Markow
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-01-10 00:00:00 -08:00
12
+ date: 2008-01-15 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency