Sha256: 9c549c543c70be63efa9a07dcba1768cf33f94846f3d893156a66ba1740c21ea

Contents?: true

Size: 882 Bytes

Versions: 18

Compression:

Stored size: 882 Bytes

Contents

#--
# Author::    Tyler Rick
# Copyright:: Copyright (c) 2007 QualitySmith, Inc.
# License::   Ruby License
# Submit to Facets?:: No!
#++

class Time
  # This should be moved elsewhere because it is subjective and depends on the context where it's used.
  def datetime_for_report(line_break = false)
    optional_line_break = (line_break ? "<br/>\n" : "")
    strftime("%I:%M %p #{optional_line_break} %B %d, %Y")   # Example: "June 18, 2006"
  end
end

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test
class TheTest < Test::Unit::TestCase

  def test_date_for_report
    assert_equal "01:49 PM  June 18, 2006", Time.mktime(2006, 6, 18, 13, 49, 4).datetime_for_report()
    assert_equal "01:49 PM <br/>\n June 18, 2006", Time.mktime(2006, 6, 18, 13, 49, 4).datetime_for_report(line_break = true)
  end

end
=end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
quality_extensions-0.1.4 lib/quality_extensions/time/deprecated.rb
qualitysmith_extensions-0.0.13 lib/qualitysmith_extensions/time/deprecated.rb
quality_extensions-0.1.1 lib/qualitysmith_extensions/time/deprecated.rb
quality_extensions-0.1.2 lib/quality_extensions/time/deprecated.rb
qualitysmith_extensions-0.0.60 lib/qualitysmith_extensions/time/deprecated.rb
qualitysmith_extensions-0.0.4 lib/qualitysmith_extensions/time/deprecated.rb
qualitysmith_extensions-0.0.17 lib/qualitysmith_extensions/time/deprecated.rb
qualitysmith_extensions-0.0.63 lib/qualitysmith_extensions/time/deprecated.rb
qualitysmith_extensions-0.0.29 lib/qualitysmith_extensions/time/deprecated.rb
qualitysmith_extensions-0.0.7 lib/qualitysmith_extensions/time/deprecated.rb
qualitysmith_extensions-0.0.5 lib/qualitysmith_extensions/time/deprecated.rb
qualitysmith_extensions-0.0.33 lib/qualitysmith_extensions/time/deprecated.rb
qualitysmith_extensions-0.0.49 lib/qualitysmith_extensions/time/deprecated.rb
qualitysmith_extensions-0.0.6 lib/qualitysmith_extensions/time/deprecated.rb
qualitysmith_extensions-0.0.64 lib/qualitysmith_extensions/time/deprecated.rb
qualitysmith_extensions-0.0.34 lib/qualitysmith_extensions/time/deprecated.rb
qualitysmith_extensions-0.0.20 lib/qualitysmith_extensions/time/deprecated.rb
qualitysmith_extensions-0.0.24 lib/qualitysmith_extensions/time/deprecated.rb