OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/lib/report/validation/dates.rb

17 lines
370 B

module Report::Validation
module Dates
def validate_dates(*values)
values = values.flatten
return true if values.empty?
values.flatten.all? do |val|
begin
!!val.to_dateish
rescue ArgumentError
errors[:date] << val
validate_dates(values - [val])
false
end
end
end
end
end