lib/csl/locale.rb in csl-1.4.2 vs lib/csl/locale.rb in csl-1.4.3

- old
+ new

@@ -345,11 +345,15 @@ # # Calls block once for each date format defined by the locale. If no # block is given, an enumerator is returned instead. def each_date if block_given? - date.each(&Proc.new) + if date.is_a? CSL::Node + yield date + else + date.each(&Proc.new) + end else enum_for :each_date end end @@ -483,10 +487,10 @@ def merge_dates(other) return self unless other.has_dates? if has_dates? other.each_date do |date| - delete_children each_date.select { |d| d[:form] == date[:form] } + delete_children(*each_date.select { |d| d[:form] == date[:form] }) add_child date.deep_copy end else other.each_date do |date| add_child date.deep_copy