Skip to content

Commit

Permalink
(zdavatz#4): Fix problems with unlimited Ablaufdatum der Zulassung
Browse files Browse the repository at this point in the history
  • Loading branch information
ngiger committed Oct 4, 2023
1 parent c8c1bf7 commit ff823c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/swissmedic-diff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ def describe_flag(diff, iksnr, flag)
sprintf "%s (%s)", txt, pairs.join(',')
when :registration_date, :expiry_date
row = diff.newest_rows[iksnr].sort.first.last
sprintf "%s (%s)", txt, row[COLUMNS_2014.keys.index(flag)].value.strftime('%d.%m.%Y')
if row[COLUMNS_2014.keys.index(flag)].value.to_s.match(REGEXP_UNLIMITED)
sprintf "%s (%s)", txt, 'unbegrenzt'
else
sprintf "%s (%s)", txt, row[COLUMNS_2014.keys.index(flag)].value.strftime('%d.%m.%Y')
end
else
row = diff.newest_rows[iksnr].sort.first.last
sprintf "%s (%s)", txt, cell(row, COLUMNS_2014.keys.index(flag))
Expand Down

0 comments on commit ff823c4

Please sign in to comment.