Defect #12359

Version date field regex validation accepts invalid date

Added by Róbert Ágoston about 5 years ago. Updated about 5 years ago.

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

0%

Category:Roadmap
Target version:2.1.3
Resolution:Fixed Affected version:2.1.2

Description

Version date field regexp validation accepts invalid dates like "2012-11-33". Stored value is nil and no validation errors.

I attached a proposed patch that fixes this bug.

version_validate_effective_date.diff Magnifier - Proposed patch. (1.63 KB) Róbert Ágoston, 2012-11-14 17:23


Related issues

Related to Redmine - Defect #9394: Custom date field only validating on regex and not a vali... Closed 2011-10-09

Associated revisions

Revision 10810
Added by Jean-Philippe Lang about 5 years ago

Fixed version date validation (#12359).

Revision 10821
Added by Jean-Philippe Lang about 5 years ago

Merged r10810 from trunk (#12359).

History

#1 Updated by Etienne Massip about 5 years ago

  • Category set to Custom fields

Why not try User.current.time_zone.parse(effective_date_before_type_cast)?

#2 Updated by Etienne Massip about 5 years ago

  • Category changed from Custom fields to Roadmap

#3 Updated by Róbert Ágoston about 5 years ago

Etienne Massip wrote:

Why not try User.current.time_zone.parse(effective_date_before_type_cast)?

I just read that "Redmine only supports YYYY-MM-DD format for entering dates".
I read that at #10560#note-2
A similar bug was fixed in r7779 with the same method.

#4 Updated by Jean-Philippe Lang about 5 years ago

  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.1.3
  • Resolution set to Fixed

Fix committed in r10810 with slight changes, thanks.

#5 Updated by Jean-Philippe Lang about 5 years ago

  • Status changed from Resolved to Closed

Merged in 2.1-stable.

Also available in: Atom PDF