Illustrated by this script. I'm running runt 0.7.0 as a gem.
#!/usr/bin/env ruby
require 'rubygems'
require 'runt' # this is runt 0.7.0
require 'yaml'
date_range = Runt::DateRange.new(Runt::PDate.civil(2008,1,1),
Runt::PDate.civil(2008,1,3), true)
p date_range.include?(Runt::PDate.civil(2008,1,2,23,59,59) )
s = date_range.to_yaml
yaml_date_range = YAML::load s
p yaml_date_range.include?(Runt::PDate.civil(2008,1,2,23,59,59) )
p date_range.to_yaml
p yaml_date_range.to_yaml
+++++++++++++++++
results of run
true
false
"--- !ruby/range:Runt::DateRange \nbegin: &id002 2008-01-01T00:00:00Z\nend: &id001 2008-01-03T00:00:00Z\nexcl:
true\n\"@end_expr\": *id001\n\"@start_expr\": *id002\n"
"--- !ruby/range:Runt::DateRange \nbegin: &id002 2008-01-01 00:00:00 Z\nend: &id001 2008-01-03 00:00:00
Z\nexcl: true\n\"@end_expr\": *id001\n\"@start_expr\": *id002\n"
+++++++++++++++++
note the times-stamps are missing a T and there is a space preceeding the Z.
|