| Class | XSD::XSDGMonth |
| In: |
lib/xsd/datatypes.rb
|
| Parent: | XSDAnySimpleType |
| Type | = | QName.new(Namespace, GMonthLiteral) |
# File lib/xsd/datatypes.rb, line 850
850: def initialize(value = nil)
851: init(Type, value)
852: end
# File lib/xsd/datatypes.rb, line 866
866: def _to_s
867: s = format('%02d', @data.mon)
868: add_tz(s)
869: end
# File lib/xsd/datatypes.rb, line 856
856: def screen_data_str(t)
857: /^(\d\d)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ t.to_s.strip
858: unless Regexp.last_match
859: raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.")
860: end
861: mon = $1.to_i
862: zonestr = $2
863: DateTime.civil(1, mon, 1, 0, 0, 0, tz2of(zonestr))
864: end