h1. partial-date * "Homepage":https://github.com/58bits/partial-date#readme * "Issues":https://github.com/58bits/partial-date/issues * "Documentation":http://rubydoc.info/gems/partial-date/frames h2. Description A simple date class that can be used to store partial date values in a single column/attribute. An example use case would include an archive, or catalogue entry where the complete date is unknown. h2. Features PartialDate::Date uses an 8 digit integer to store year, month and day values. Values for month and day are optional. h2. Examples bc.. require 'partial-date' #Default initializer date = PartialDate::Date.new # => date.value # => 0 # Initialize from a block of integers date = PartialDate::Date.new {|d| d.year = 2012, d.month = 01} # => 2012-01 date.value # => 20120100 # Initialize from a block of strings date = PartialDate::Date.new {|d| d.year = "2012", d.month = "01"} # => 2012-01 date.value # => 20120100 # Initialize from the class load method - for rehydrating a date instance from a stored integer date value. date = PartialDate::Date.load 20121201 # => 2012-12-01 date.year # => 2012 date.month # => 12 date.day # => 1 h2. Install @$ gem install partial-date@ h2. TODO Implement @PartialDate::Date.parse@ method for construction from strings. h2. Copyright Copyright (c) 2012 Anthony Bouch See {file:LICENSE.txt} for details.