From 1c8dc4b33112573523352cbc1cf65c017323b13f Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Sat, 19 Feb 2011 16:53:26 -0800 Subject: [PATCH] Better rdoc linking to strftime formatting codes --- lib/date.rb | 7 ++++++- lib/date/format.rb | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/date.rb b/lib/date.rb index 079a6059bbb2a3..30f5e140f4fe26 100644 --- a/lib/date.rb +++ b/lib/date.rb @@ -211,6 +211,11 @@ # The Date class includes the Comparable module, allowing # date objects to be compared and sorted, ranges of dates # to be created, and so forth. +# +# See the Date::parse and Date::strptime methods to parse Dates +# and Date#strftime for formatting Dates. See Time#strftime for +# details on supported formats. + class Date include Comparable @@ -1024,7 +1029,7 @@ def self.new_by_frags(elem, sg) # :nodoc: # # +str+ is a String holding a date representation. # +fmt+ is the format that the date is in. See - # date/format.rb for details on supported formats. + # Time#strftime for details on supported formats. # # The default +str+ is '-4712-01-01', and the default # +fmt+ is '%F', which means Year-Month-Day_of_Month. diff --git a/lib/date/format.rb b/lib/date/format.rb index 6894e945e3a9b0..7b6eb55ea89862 100644 --- a/lib/date/format.rb +++ b/lib/date/format.rb @@ -210,6 +210,7 @@ def emit_au(e, w, f) # :nodoc: private :emit, :emit_w, :emit_n, :emit_sn, :emit_z, :emit_a, :emit_ad, :emit_au + # See Time#strftime for details on supported formats. def strftime(fmt='%F') fmt.gsub(/%([-_0^#]+)?(\d+)?([EO]?(?::{1,3}z|.))/m) do f = {} pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy