Project

General

Profile

Actions

Defect #12359

closed

Version date field regex validation accepts invalid date

Added by Róbert Ágoston over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Category:
Roadmap
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

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.


Files

version_validate_effective_date.diff (1.63 KB) version_validate_effective_date.diff Proposed patch. 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 valid dateClosed2011-10-09

Actions
Actions #1

Updated by Etienne Massip over 11 years ago

  • Category set to Custom fields

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

Actions #2

Updated by Etienne Massip over 11 years ago

  • Category changed from Custom fields to Roadmap
Actions #3

Updated by Róbert Ágoston over 11 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.

Actions #4

Updated by Jean-Philippe Lang over 11 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.

Actions #5

Updated by Jean-Philippe Lang over 11 years ago

  • Status changed from Resolved to Closed

Merged in 2.1-stable.

Actions

Also available in: Atom PDF