improved calc-registo-dias.rb