Changeset 1828 for WAeUP_SRP/trunk/PatchExtendedWidgetsCPSDateTimeWidget.py
- Timestamp:
- 29 May 2007, 15:40:38 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/PatchExtendedWidgetsCPSDateTimeWidget.py
r1804 r1828 3 3 from DateTime.DateTime import DateTime 4 4 from Products.CPSSchemas.ExtendedWidgets import CPSDateTimeWidget 5 CPSDateTimeWidget.time_hour_default = '00' 5 6 6 7 def validate(self, datastructure, **kw): … … 30 31 datamodel[field_id] = None 31 32 return 1 32 33 # import pdb;pdb.set_trace() 33 34 if self.view_format.startswith('iso8601'): 34 35 if re.match(r'^[0-9]+-[0-9]{2}-[0-9]{2}', date) is not None: … … 39 40 else: 40 41 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: 46 47 else: 47 48 datastructure.setError(widget_id, 'cpsschemas_err_date') … … 58 59 datamodel[field_id] = v 59 60 return 1 61 60 62 61 63 CPSDateTimeWidget.validate = validate
Note: See TracChangeset for help on using the changeset viewer.