- Timestamp:
- 14 Apr 2012, 14:13:39 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/widgets/datewidget.py
r8150 r8152 90 90 def __init__(self, context, request, *args, **kw): 91 91 # try to grab date_format and show_year from bound schema field. 92 self.date_format = getattr(context, 'date_format', self.date_format) 92 date_format = getattr(context, 'date_format', self.date_format) 93 if date_format is not None: 94 self.date_format = date_format 93 95 self.show_year = getattr(context, 'show_year', self.show_year) 94 96 # add css class determined by date_format and show_year … … 136 138 def __init__(self, context, request, *args, **kw): 137 139 # try to grab date_format and show_year from bound schema field. 138 self.date_format = getattr(context, 'date_format', self.date_format) 140 date_format = getattr(context, 'date_format', self.date_format) 141 if date_format is not None: 142 self.date_format = date_format 139 143 self.show_year = getattr(context, 'show_year', self.show_year) 140 144 return super(FormattedDateDisplayWidget, self).__init__( … … 152 156 cssClass=self.cssClass) 153 157 158 class DateLEWidget(FormattedDateWidget): 159 date_format = '%d/%m/%Y' 160 161 class DateDEWidget(FormattedDateWidget): 162 date_format = '%d.%m.%Y' 163 164 class DateUSWidget(FormattedDateWidget): 165 date_format = '%m/%d/%Y' 166 167 class DateLEDisplayWidget(FormattedDateDisplayWidget): 168 date_format = '%d/%m/%Y' 169 170 class DateDEDisplayWidget(FormattedDateDisplayWidget): 171 date_format = '%d.%m.%Y' 172 173 class DateUSDisplayWidget(FormattedDateDisplayWidget): 174 date_format = '%m/%d/%Y' 175 154 176 def FriendlyDateWidget(format): 155 177 """Get a friendly date input widget for `format`.
Note: See TracChangeset for help on using the changeset viewer.