Changeset 6868 for main/waeup.sirp/trunk
- Timestamp:
- 10 Oct 2011, 15:18:08 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/widgets/datewidget.py
r6867 r6868 69 69 return "" 70 70 content = content.strftime(self.date_format) 71 return renderElement("span", contents=escape(content),72 cssClass=self.cssClass)73 74 class FormattedDatetimeDisplayWidget(DatetimeDisplayWidget):75 """A datetime widget that supports different (and _explicit_) date formats.76 77 This is a display widget.78 """79 datetime_format = '%Y-%m-%d %H:%M:%S'80 implements(IDisplayWidget)81 82 def __call__(self):83 if self._renderedValueSet():84 content = self._data85 else:86 content = self.context.default87 if content == self.context.missing_value:88 return ""89 content = content.strftime(self.datetime_format)90 71 return renderElement("span", contents=escape(content), 91 72 cssClass=self.cssClass) … … 172 153 173 154 Valid `format` values are the keys of :var:`DATE_FORMATS` 174 dict. Default is ``le`` (little endian; DD/MM/YYYY ).155 dict. Default is ``le`` (little endian; DD/MM/YYYY %H:%M:%S). 175 156 176 157 This widget is not rendered with a specialized CSS tag for … … 181 162 datetime_format = date_format + ' %H:%M:%S' 182 163 return CustomWidgetFactory( 183 FormattedDate timeDisplayWidget,184 date time_format=datetime_format)164 FormattedDateDisplayWidget, 165 date_format=datetime_format)
Note: See TracChangeset for help on using the changeset viewer.