Sha256: 6dc3c29d6c2181d4e9551076ef42aa0f76dcea68c1bb2faf362838d01cdcd117

Contents?: true

Size: 943 Bytes

Versions: 2

Compression:

Stored size: 943 Bytes

Contents

# sbJson 1.0 writer date

# History:
#  Stan Smith 2017-06-01 original script

require_relative 'sbJson_codelists'

module ADIWG
   module Mdtranslator
      module Writers
         module SbJson

            module Date

               def self.build(hCitation)

                  aDates = []

                  hCitation[:dates].each do |hDate|
                     sbDate = {}
                     sbDate[:type] = Codelists.codelist_iso_to_sb('iso_sb_date', :isoCode => hDate[:dateType])
                     sbDate[:dateString] = AdiwgDateTimeFun.stringFromDateObject(hDate)
                     sbDate[:label] = hDate[:description] unless hDate[:description].nil?
                     aDates << sbDate unless sbDate[:type].nil?
                  end

                  if aDates.empty?
                     return nil
                  end

                  aDates

               end

            end

         end
      end
   end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.0.0rc10 lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_date.rb
adiwg-mdtranslator-2.0.0rc9 lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_date.rb