Class: Cms::DatePicker

Inherits:
Object
  • Object
show all
Defined in:
lib/cms/date_picker.rb

Overview

Helper methods for centralizing Date handling for the CMS. Eventually, we will need a way to handle i18n formatting of dates, but I would also like to have US style dates for US locales (M/d/yy), but since Ruby 1.8.7 and 1.9.2 have different handling of Date.parse, that would take some monkeypatching.

Class Method Summary collapse

Class Method Details

.format_for_ui(date) ⇒ Object



18
19
20
# File 'lib/cms/date_picker.rb', line 18

def format_for_ui(date)
  date ? date.strftime('%Y/%m/%d') : nil
end

.jquery_formatObject

Returns the date format that the JQuery selector will need to use.



14
15
16
# File 'lib/cms/date_picker.rb', line 14

def jquery_format
  'yy/mm/dd'
end