Included Modules

Files

Class Index [+]

Quicksearch

XSD::XSDDate

Constants

Type

Public Class Methods

new(value = nil) click to toggle source
     # File lib/xsd/datatypes.rb, line 719
719:   def initialize(value = nil)
720:     init(Type, value)
721:   end

Private Instance Methods

_to_s() click to toggle source
     # File lib/xsd/datatypes.rb, line 740
740:   def _to_s
741:     year = (@data.year > 0) ? @data.year : @data.year - 1
742:     s = format('%.4d-%02d-%02d', year, @data.mon, @data.mday)
743:     add_tz(s)
744:   end
screen_data_str(t) click to toggle source
     # File lib/xsd/datatypes.rb, line 725
725:   def screen_data_str(t)
726:     /^([+\-]?\d{4,})-(\d\d)-(\d\d)(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ t.to_s.strip
727:     unless Regexp.last_match
728:       raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.")
729:     end
730:     year = $1.to_i
731:     if year < 0
732:       year += 1
733:     end
734:     mon = $2.to_i
735:     mday = $3.to_i
736:     zonestr = $4
737:     DateTime.civil(year, mon, mday, 0, 0, 0, tz2of(zonestr))
738:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.