DateUtils 0.3.1 → 0.3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/date_utils.rb +5 -3
- metadata +2 -2
data/lib/date_utils.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
#--
|
4
4
|
# Copyright (c) 2007 Rene Paulokat
|
5
5
|
# This program is free software; you can redistribute it and/or modify
|
6
|
-
# it under the terms of the GNU General
|
6
|
+
# it under the terms of the GNU General PublicF License as published by
|
7
7
|
# the Free Software Foundation; either version 2 of the License, or
|
8
8
|
# (at your option) any later version.
|
9
9
|
#
|
@@ -358,6 +358,8 @@ module DateUtils
|
|
358
358
|
@num_days = 30 if [4,6,9,11].include?(@month)
|
359
359
|
( date.leap? ? (@num_days = 29) : (@num_days = 28) ) if @month == 2
|
360
360
|
@last_day = @first_day + ( @num_days - 1 )
|
361
|
+
# XXX instance-variable 'year' added.
|
362
|
+
@year = @date.year
|
361
363
|
end
|
362
364
|
|
363
365
|
end
|
@@ -423,7 +425,7 @@ module DateUtils
|
|
423
425
|
arr = []
|
424
426
|
week = Week.new(d)
|
425
427
|
arr.push(week)
|
426
|
-
for i in 1..
|
428
|
+
for i in 1..53
|
427
429
|
week = week.next
|
428
430
|
arr.push(week)
|
429
431
|
end
|
@@ -433,7 +435,7 @@ module DateUtils
|
|
433
435
|
# returns Week 'num' of self
|
434
436
|
#
|
435
437
|
def get_week(num)
|
436
|
-
! num.kind_of?(Fixnum) || num >
|
438
|
+
! num.kind_of?(Fixnum) || num > 53 ? ArgumentError.new("invalid week-number 'num'"): self.weeks[num -1]
|
437
439
|
end
|
438
440
|
|
439
441
|
# returns Month 'num' of self
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: DateUtils
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.3.1
|
7
|
-
date: 2007-
|
6
|
+
version: 0.3.1.1
|
7
|
+
date: 2007-11-04 00:00:00 +01:00
|
8
8
|
summary: Some handy utils to deal with Date
|
9
9
|
require_paths:
|
10
10
|
- lib
|