Class | Date
In: | vendor/plugins/brazilian-rails/lib/date_portuguese.rb
Parent: | Object

### Methods

to_s_br valid?

### Public Class methods

valid?(date)

Valida se uma string eh uma data valida

Exemplo:

     Date.valid?('01/01/2007') ==> true
     Date.valid?('32/01/2007') ==> false

[Source]

        # File vendor/plugins/brazilian-rails/lib/date_portuguese.rb, line 26
    26:   def self.valid?(date)
    27:     begin
    28:       date = date.to_date
    29:       Date.valid_civil?(date.year, date.month, date.day)
    30:     rescue
    31:       return false
    32:     end
    33:     true
    34:   end

### Public Instance methods

to_s_br()

Retorna a data no padrao brasileiro

Exemplo:

     data = Date.new(2007, 9, 27)
     data.to_s_br ==> "27/09/2007"

[Source]

        # File vendor/plugins/brazilian-rails/lib/date_portuguese.rb, line 17
    17:   def to_s_br
    18:     strftime("%d/%m/%Y")
    19:   end

[Validate]