Ignore:
Timestamp:
29 May 2007, 15:40:38 (17 years ago)
Author:
joachim
Message:

fix for #232

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/PatchExtendedWidgetsCPSDateTimeWidget.py

    r1804 r1828  
    33from DateTime.DateTime import DateTime
    44from Products.CPSSchemas.ExtendedWidgets import CPSDateTimeWidget
     5CPSDateTimeWidget.time_hour_default = '00'
    56
    67def validate(self, datastructure, **kw):
     
    3031            datamodel[field_id] = None
    3132            return 1
    32 
     33    # import pdb;pdb.set_trace()
    3334    if self.view_format.startswith('iso8601'):
    3435        if re.match(r'^[0-9]+-[0-9]{2}-[0-9]{2}', date) is not None:
     
    3940    else:
    4041        if re.match(r'^[0-9]?[0-9]/[0-9]?[0-9]/[0-9]{2,4}$', date) is not None:
    41             locale = self.translation_service.getSelectedLanguage()
    42             if locale in ('en', 'hu'):
    43                 m, d, y = date.split('/')
    44             else:
    45                 d, m, y = date.split('/')
     42            d, m, y = date.split('/') # always use d/m/y
     43            # locale = self.translation_service.getSelectedLanguage()
     44            # if False and locale in ('en', 'hu'):
     45            #     m, d, y = date.split('/')
     46            # else:
    4647        else:
    4748            datastructure.setError(widget_id, 'cpsschemas_err_date')
     
    5859        datamodel[field_id] = v
    5960        return 1
     61   
    6062
    6163CPSDateTimeWidget.validate = validate
Note: See TracChangeset for help on using the changeset viewer.