def getDateString(self, widget):
     if widget.getStyle() & swt.SWT.TIME:
         widgetDate = Date()
         widgetDate.setHours(widget.getHours())
         widgetDate.setMinutes(widget.getMinutes())
         widgetDate.setSeconds(widget.getSeconds())
         return util.getDateFormat(swt.SWT.TIME).format(widgetDate)
     else:
         widgetDate = Date(widget.getYear() - 1900, widget.getMonth(), widget.getDay())
         return util.getDateFormat(swt.SWT.DATE).format(widgetDate)
Example #2
0
 def getDateFormat(self):
     if runOnUIThread(self.widget.widget.widget.getStyle) & swt.SWT.TIME:
         return util.getDateFormat(swt.SWT.TIME)
     else:
         return util.getDateFormat(swt.SWT.DATE)