adjust templates, add timezone and locale
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Accounts
|
||||
module_function
|
||||
|
||||
def normalize_timezone(timezone)
|
||||
tzinfo = TZInfo::Timezone.get(ActiveSupport::TimeZone::MAPPING[timezone] || timezone)
|
||||
|
||||
::ActiveSupport::TimeZone.all.find { |e| e.tzinfo == tzinfo }&.name || timezone
|
||||
end
|
||||
end
|
||||
@@ -135,7 +135,7 @@ module Submissions
|
||||
height - (area['y'] * height))
|
||||
end
|
||||
else
|
||||
value = I18n.l(Date.parse(value)) if field['type'] == 'date'
|
||||
value = I18n.l(Date.parse(value), format: :long) if field['type'] == 'date'
|
||||
|
||||
text = HexaPDF::Layout::TextFragment.create(Array.wrap(value).join(', '), font: pdf.fonts.add(FONT_NAME),
|
||||
font_size: FONT_SIZE)
|
||||
|
||||
Reference in New Issue
Block a user