Skip to content

Commit

Permalink
FIX Invalid date on XML
Browse files Browse the repository at this point in the history
  • Loading branch information
otavioschwanck committed Mar 7, 2019
1 parent ab93655 commit e7635e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## CHANGELOG

## 0.2.24 [2019-03-07]
- [Corrigido] Data bugada no XML

## 0.2.21 [2018-11-15]
- [Atualizando] versão da gem ox

Expand Down
6 changes: 5 additions & 1 deletion lib/br_invoices_pdf/nfce/parser/emission_details.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ def check_url(xml)
private_class_method :check_url

def locate_element_to_date(xml, path)
Time.parse(locate_element(xml, path)).utc
begin
Time.parse(locate_element(xml, path)).utc
rescue StandardError => e
Time.parse("#{locate_element(xml, path)[0..18]}-03:00").utc
end
end
private_class_method :locate_element_to_date
end
Expand Down
2 changes: 1 addition & 1 deletion lib/br_invoices_pdf/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module BrInvoicesPdf
VERSION = '0.2.23'
VERSION = '0.2.24'
end

0 comments on commit e7635e9

Please sign in to comment.