Skip to content

Add way to check is a string is a valid date #38

Description

@abitdodgy

Is it possible to add a way just to check if a given string is a valid date?

validates :release_date, date: true

@product.release_date = "1/1/ab"
@product.should_not be_valid

Failure/Error: @product.should_not be_valid
       expected #<Product id: nil, name: "Assassin's Creed", properties: {"platform"=>"PS3", "release_date"=>"31/12/ab"}> not to be valid

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions