Module: LocaleHelper

Defined in:
app/helpers/locale_helper.rb

Instance Method Summary collapse

Instance Method Details

#format_date(date) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/helpers/locale_helper.rb', line 11

def format_date(date)
 if date.instance_of? String
   begin
   date = Time.parse date
    rescue
      date = ''
      return date
    end
  end
  
 date.strftime("%d/%m/%Y") unless date==nil
end

#format_datetime(datetime) ⇒ Object



3
4
5
6
7
8
9
# File 'app/helpers/locale_helper.rb', line 3

def format_datetime(datetime)
  if datetime.instance_of? String
    datetime = Time.parse datetime
   end
   
	datetime.strftime("%d/%m/%Y %H:%m") unless datetime==nil
end