Ticket #2055 (new defect)

Opened 10 years ago

Date format not honoured

Reported by: madarche Owned by: madarche
Priority: P2 Milestone: CPS 3.5.7
Component: CPS (global) Version: TRUNK
Severity: normal Keywords:


The date field does not honour the date format set in the Localizer field collector_date_%m/%d/%Y %H:%M. I changed this translation to %d/%m/%Y %H:%M.

This is only a problem if you use English and something other than m/d/y dates, or French with something other than d/m/y. In Australia we use d/m/y format dates.

The problem comes from the Form.py file (about line 524) where there are a couple of regular expressions that check the date format for French and English.

            if locale == 'en':
                if not match(r'^((0?[1-9])|(1[0-2]))/((0?[1-9])|([12][0-9])|(3[01]))/[0-9]{4,4}$', v):
                    err = 'collector_field_date_invalid'
            elif locale == 'fr':

This is not a new issue, or a major one for me. I have been modifying this file since I have been using CPSCollector, but I think somebody else must be (or will be) effected by this as well as me.

Note: See TracTickets for help on using tickets.