Sha256: 96ae6fe52d3871b0def893610b2b9c6535e0908462b1d616bec510594b31ccdf

Contents?: true

Size: 339 Bytes

Versions: 2

Compression:

Stored size: 339 Bytes

Contents

module Util
  def Util.init_date_of_book(book)
    if not book["end"]
      book["end"] = Time.now.year
    end

    if not book["start"]
      book["start"] = book["end"]
    end

    if book["start"] == book["end"]
      book["date"] = book["start"].to_s
    else
      book["date"] = "#{book["start"]}-#{book["end"]}"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jekyll-books-0.1.1 lib/util.rb
jekyll-books-0.1.0 lib/util.rb