Skip to content

Commit

Permalink
Merge pull request #44 from pdvend/hotfix/invalid_date_on_xml
Browse files Browse the repository at this point in the history
FIX Invalid date on XML
  • Loading branch information
pdvend committed Mar 7, 2019
2 parents ab93655 + d3e24b9 commit 8b1e5cc
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
element = locate_element(xml, path)

Time.parse(element).utc
rescue StandardError => _e
Time.parse("#{element[0..18]}-03:00").utc
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 8b1e5cc

Please sign in to comment.