ledger_web 1.4.10 → 1.4.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -39,8 +39,8 @@ module LedgerWeb
39
39
  session[:from] = Date.new(today.year - 1, today.month, today.day).strftime('%Y/%m/%d')
40
40
  session[:to] = today.strftime('%Y/%m/%d')
41
41
  else
42
- session[:from] = Date.strptime(params[:from], '%Y/%m/%d').strftime('%Y/%m/%d')
43
- session[:to] = Date.strptime(params[:to], '%Y/%m/%d').strftime('%Y/%m/%d')
42
+ session[:from] = Date.parse(params[:from]).strftime('%Y/%m/%d')
43
+ session[:to] = Date.parse(params[:to]).strftime('%Y/%m/%d')
44
44
  end
45
45
 
46
46
  redirect back
@@ -1,3 +1,3 @@
1
1
  module LedgerWeb
2
- VERSION = '1.4.10'
2
+ VERSION = '1.4.11'
3
3
  end
data/test/report_spec.rb CHANGED
@@ -65,5 +65,17 @@ describe LedgerWeb::Report do
65
65
  [Date.new(2012,1,1), 190, 100, -300, 10]
66
66
  ])
67
67
  end
68
+
69
+ it "should respect other date formats" do
70
+ LedgerWeb::Report.session = {:from => '2012-01-01', :to => '2012-01-01'}
71
+ load_fixture('small')
72
+
73
+ report = LedgerWeb::Report.from_query("select xtn_month, account, sum(amount)::integer from ledger group by xtn_month, account")
74
+ report = report.pivot("account", "asc")
75
+
76
+ report.rows.should eq([
77
+ [Date.new(2012,1,1), 190, 100, -300, 10]
78
+ ])
79
+ end
68
80
  end
69
81
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ledger_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.10
4
+ version: 1.4.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-03 00:00:00.000000000Z
12
+ date: 2013-01-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pg
@@ -323,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
323
323
  version: '0'
324
324
  requirements: []
325
325
  rubyforge_project:
326
- rubygems_version: 1.8.19
326
+ rubygems_version: 1.8.23
327
327
  signing_key:
328
328
  specification_version: 3
329
329
  summary: A web-based, sql-backed front-end for the Ledger command-line accounting
@@ -336,3 +336,4 @@ test_files:
336
336
  - test/fixtures/small.dat
337
337
  - test/report_spec.rb
338
338
  - test/spec_helper.rb
339
+ has_rdoc: