mirror of
https://github.com/github/rails.git
synced 2026-01-30 16:58:15 -05:00
time_zone_select docs: explain priority zones option. Add example showing a custom set of priority zones.
This commit is contained in:
@@ -146,6 +146,12 @@ module ActionView
|
||||
# to TimeZone. This may be used by users to specify a different time
|
||||
# zone model object. (See #time_zone_options_for_select for more
|
||||
# information.)
|
||||
#
|
||||
# You can also supply an array of TimeZone objects
|
||||
# as +priority_zones+, so that they will be listed above the rest of the
|
||||
# (long) list. (You can use TimeZone.us_zones as a convenience for
|
||||
# obtaining a list of the US time zones.)
|
||||
#
|
||||
# Finally, this method supports a <tt>:default</tt> option, which selects
|
||||
# a default TimeZone if the object's time zone is nil.
|
||||
#
|
||||
@@ -156,6 +162,8 @@ module ActionView
|
||||
#
|
||||
# time_zone_select( "user", 'time_zone', TimeZone.us_zones, :default => "Pacific Time (US & Canada)")
|
||||
#
|
||||
# time_zone_select( "user", 'time_zone', [ TimeZone['Alaska'], TimeZone['Hawaii'] ])
|
||||
#
|
||||
# time_zone_select( "user", "time_zone", TZInfo::Timezone.all.sort, :model => TZInfo::Timezone)
|
||||
def time_zone_select(object, method, priority_zones = nil, options = {}, html_options = {})
|
||||
InstanceTag.new(object, method, self, nil, options.delete(:object)).to_time_zone_select_tag(priority_zones, options, html_options)
|
||||
|
||||
Reference in New Issue
Block a user