Defect #10560

strange validation in redmine core

Added by ilya boltnev over 7 years ago. Updated over 7 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Plugin API
Target version:-
Resolution:Duplicate Affected version:

Description

I've developing redmine plugin, and discover this line of code in Version model:

validates_format_of :effective_date, :with => /^\d{4}-\d{2}-\d{2}$/, :message => :not_a_date, :allow_nil => true

I've changed Rails date format by adding

Date::DATE_FORMATS[:default]="%d.%m.%Y"

in initializer, and now I can't save my Version.

Two questions to developers:

1.Why do we need for this line? Are we need to validate effective_date of version so hard?

2.What should I do to solve this problem? I need my date format

environment: ruby Entrprise Edition, rails 2.3.14, mysql 5.1,svn 1.6


Related issues

Related to Redmine - Defect #668: Date input fields don't respect date format settings New 2008-02-15

History

#1 Updated by ilya boltnev over 7 years ago

  • Assignee set to Jean-Philippe Lang

#2 Updated by Jean-Philippe Lang over 7 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

Redmine only supports YYYY-MM-DD format for entering dates. See #668.

Also available in: Atom PDF