partial-date 1.1.1 → 1.1.2
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/ChangeLog.textile +9 -1
- data/README.textile +3 -3
- data/lib/partial-date/version.rb +1 -1
- metadata +1 -1
data/ChangeLog.textile
CHANGED
@@ -1,6 +1,14 @@
|
|
1
|
+
h3. 1.1.2 / 2012-05-27
|
2
|
+
|
3
|
+
* Fixed syntax error in example code from README.
|
4
|
+
|
5
|
+
h3. 1.1.1 / 2012-05-27
|
6
|
+
|
7
|
+
* Updated tests and documentation.
|
8
|
+
|
1
9
|
h3. 1.1.0 / 2012-05-27
|
2
10
|
|
3
|
-
* Implemented a
|
11
|
+
* Implemented a 23 bit store as backing store for date,
|
4
12
|
reducing the storage requirements and increasing performance
|
5
13
|
of date objects.
|
6
14
|
|
data/README.textile
CHANGED
@@ -10,7 +10,7 @@ A simple date class that can be used to store partial date values in a single co
|
|
10
10
|
|
11
11
|
h2. Features
|
12
12
|
|
13
|
-
PartialDate::Date uses a
|
13
|
+
PartialDate::Date uses a 23 bit register as the backing store for date instances, and bit fiddling to get or set year, month and day values. As such it will perform well in a loop or collection of date objects.
|
14
14
|
|
15
15
|
Use @date.value@ to get or set an Integer value that can be used to rehydrate a date object, or save the date value to a persistance store in a readable Integer form e.g. 20121201 for 2012 December 01.
|
16
16
|
|
@@ -25,13 +25,13 @@ date.value
|
|
25
25
|
# => 0
|
26
26
|
|
27
27
|
# Initialize from a block of integers
|
28
|
-
date = PartialDate::Date.new {|d| d.year = 2012
|
28
|
+
date = PartialDate::Date.new {|d| d.year = 2012; d.month = 01}
|
29
29
|
# => 2012-01
|
30
30
|
date.value
|
31
31
|
# => 20120100
|
32
32
|
|
33
33
|
# Initialize from a block of strings
|
34
|
-
date = PartialDate::Date.new {|d| d.year = "2012"
|
34
|
+
date = PartialDate::Date.new {|d| d.year = "2012"; d.month = "01"}
|
35
35
|
# => 2012-01
|
36
36
|
date.value
|
37
37
|
# => 20120100
|
data/lib/partial-date/version.rb
CHANGED