knjrbfw 0.0.36 → 0.0.37

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 CHANGED
@@ -1 +1 @@
1
- 0.0.36
1
+ 0.0.37
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{knjrbfw}
8
- s.version = "0.0.36"
8
+ s.version = "0.0.37"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
@@ -310,7 +310,7 @@ class Knj::Objects
310
310
  end
311
311
 
312
312
  found = true
313
- elsif args.key?(:cols_date) and match = key.match(/^(.+)_(day|month|year|from|to|below|above)$/) and args[:cols_date].index(match[1]) != nil
313
+ elsif args.key?(:cols_date) and match = key.match(/^(.+)_(day|week|month|year|from|to|below|above)$/) and args[:cols_date].index(match[1]) != nil
314
314
  val = Knj::Datet.in(val) if val.is_a?(Time)
315
315
 
316
316
  if match[2] == "day"
@@ -332,6 +332,8 @@ class Knj::Objects
332
332
  else
333
333
  sql_where << " AND DATE_FORMAT(#{table}`#{db.esc_col(match[1])}`, '%d %m %Y') = DATE_FORMAT('#{db.esc(val.dbstr)}', '%d %m %Y')"
334
334
  end
335
+ elsif match[2] == "week"
336
+ sql_where << " AND #{db.sqlspecs.strftime("%W %Y", "#{table}`#{db.esc_col(match[1])}`")} = #{db.sqlspecs.strftime("%W %Y", "'#{db.esc(val.dbstr)}'")}"
335
337
  elsif match[2] == "month"
336
338
  sql_where << " AND #{db.sqlspecs.strftime("%m %Y", "#{table}`#{db.esc_col(match[1])}`")} = #{db.sqlspecs.strftime("%m %Y", "'#{db.esc(val.dbstr)}'")}"
337
339
  elsif match[2] == "year"
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: knjrbfw
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.36
5
+ version: 0.0.37
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kasper Johansen
@@ -374,7 +374,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
374
374
  requirements:
375
375
  - - ">="
376
376
  - !ruby/object:Gem::Version
377
- hash: -15958701086613038
377
+ hash: 551791089226574837
378
378
  segments:
379
379
  - 0
380
380
  version: "0"