Sha256: de26646515c0792e9e588e62e511c08dfbed6f8e1cbbaa13188b6eb86e79bba0
Contents?: true
Size: 465 Bytes
Versions: 7
Compression:
Stored size: 465 Bytes
Contents
require 'date' module PR module Fields class DateField Format = '%d/%m/%Y' def initialize value = '', options = {} @value, @options = value, options end attr_reader :options def raw @value end def populate date @value = date.strftime Format end def convert Date.strptime(@value,Format) rescue ArgumentError raise InvalidValue end end end end
Version data entries
7 entries across 7 versions & 1 rubygems