Bug Tracker

Modify

Ticket #4781 (closed enhancement: invalid)

Opened 4 years ago

Last modified 3 years ago

new validate method

Reported by: mikeybates Owned by: joern
Priority: major Milestone: 1.4
Component: plugin Version: 1.3.2
Keywords: Cc:
Blocking: Blocked by:

Description

please consider this as a replacement for the dateISO validation. The new regular expression comes from here:  http://regexlib.com/REDetails.aspx?regexp_id=2092 and checks for ISO date format. The old method would allow things like 2009-31-31 and 2009-02-31

dateISO: function(value, element) {

return this.optional(element)
/(\d{4}(?:(?:(?:\-)?(?:00[1-9]|0[1-9][0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-6]))?|(?:(?:\-)?(?:1[0-2]|0[1-9]))?|(?:(?:\-)?(?:1[0-2]|0[1-9])(?:\-)?(?:0[1-9]|[12][0-9]|3[01]))?|(?:(?:\-)?W(?:0[1-9]|[1-4][0-9]5[0-3]))?|(?:(?:\-)?W(?:0[1-9]|[1-4][0-9]5[0-3])(?:\-)?[1-7])?)?)$/.test(value);

}

Change History

comment:1 Changed 4 years ago by dmethvin

  • Owner set to joern
  • Component changed from unfilled to plugin

comment:2 Changed 3 years ago by john

  • Status changed from new to closed
  • Resolution set to invalid

Please file plugin bugs with the appropriate author on their bug tracker.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.