class method self.register

Ruby on Rails edge

Since edge

Signature

self.register(name, format)

Registers a new date format for formatting Time instances. See Time::DATE_FORMATS for built-in formats. Use the format name as the name and either a strftime string or Proc instance that takes a date argument as the value.

Parameters

name req
format req
Source
# File activesupport/lib/active_support/time_formats.rb, line 38
    def self.register(name, format)
      @list = @list.merge(name => format).freeze
    end

Defined in activesupport/lib/active_support/time_formats.rb line 38 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::TimeFormats

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close