Project

General

Profile

Actions

Defect #10560

closed

strange validation in redmine core

Added by ilya boltnev about 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Category:
Plugin API
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
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 settingsNewJean-Philippe Lang2008-02-15

Actions
Actions #1

Updated by ilya boltnev about 12 years ago

  • Assignee set to Jean-Philippe Lang
Actions #2

Updated by Jean-Philippe Lang about 12 years ago

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

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

Actions

Also available in: Atom PDF