descending sort order on time stamp
This commit is contained in:
parent
2d2240244e
commit
2a532dba86
2 changed files with 8 additions and 1 deletions
|
@ -217,6 +217,7 @@ class TrackDateField(Field):
|
||||||
fieldType = 'date'
|
fieldType = 'date'
|
||||||
part = 'date'
|
part = 'date'
|
||||||
format = 'short'
|
format = 'short'
|
||||||
|
descending = False
|
||||||
cssClass = 'right'
|
cssClass = 'right'
|
||||||
|
|
||||||
def getValue(self, row):
|
def getValue(self, row):
|
||||||
|
@ -239,6 +240,12 @@ class TrackDateField(Field):
|
||||||
return ''
|
return ''
|
||||||
return timeStamp2ISO(value)[:10]
|
return timeStamp2ISO(value)[:10]
|
||||||
|
|
||||||
|
def getSortValue(self, row):
|
||||||
|
value = self.getRawValue(row)
|
||||||
|
if value and self.descending:
|
||||||
|
return -value
|
||||||
|
return value or None
|
||||||
|
|
||||||
|
|
||||||
class TrackTimeField(TrackDateField):
|
class TrackTimeField(TrackDateField):
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ class CommentsOverview(ReportConceptView):
|
||||||
|
|
||||||
timeStamp = TrackDateField('timeStamp', u'Timestamp',
|
timeStamp = TrackDateField('timeStamp', u'Timestamp',
|
||||||
description=u'The date and time the comment was posted.',
|
description=u'The date and time the comment was posted.',
|
||||||
part='dateTime',
|
part='dateTime', descending=True,
|
||||||
executionSteps=['sort', 'output'])
|
executionSteps=['sort', 'output'])
|
||||||
target = TargetField('taskId', u'Target',
|
target = TargetField('taskId', u'Target',
|
||||||
description=u'The resource or concept the comment was posted at.',
|
description=u'The resource or concept the comment was posted at.',
|
||||||
|
|
Loading…
Add table
Reference in a new issue