Module: Ramaze::Helper::Locale
- Defined in:
- lib/zen/helper/locale.rb
Overview
Helper that can be used to display various variables based on the user's locale and settings.
Instance Method Summary (collapse)
-
- (Object) date_format
Returns the date format for the currently logged in user.
-
- (String) format_date(object)
Formats a date according to Ramaze::Helper::Locale#date_format.
Instance Method Details
- (Object) date_format
Returns the date format for the currently logged in user. If the user has no date format set (or isn't logged in) the system format is used.
16 17 18 19 20 21 22 23 24 |
# File 'lib/zen/helper/locale.rb', line 16 def date_format begin format = user.date_format rescue format = get_setting(:date_format).value end return format end |
- (String) format_date(object)
Formats a date according to Ramaze::Helper::Locale#date_format.
33 34 35 36 37 38 39 |
# File 'lib/zen/helper/locale.rb', line 33 def format_date(object) if object.respond_to?(:strftime) return object.strftime(date_format) else return nil end end |