Humanize dates in timeline

stable
Álex Hermida 2018-04-17 12:14:52 +02:00
parent 1f9aa0761c
commit 0804a62aec
5 changed files with 29 additions and 2 deletions

View File

@ -1225,6 +1225,7 @@
"CLIENT_REQUIREMENT": "Client Requirement",
"BLOCKED": "Blocked",
"VALUES": {
"NOT_SET": "not set",
"UNASSIGNED": "unassigned"
},
"FIELDS": {
@ -1234,6 +1235,7 @@
"TYPE": "type",
"ASSIGNED_TO": "assigned to",
"ASSIGNED_USERS": "assigned users",
"DUE_DATE": "due date",
"MILESTONE": "sprint",
"COLOR": "color"
}

View File

@ -1,5 +1,4 @@
a.due-date-button.button-gray.is-editable(
href=""
label.due-date-button.button-gray.is-editable(
ng-if="vm.visible()"
ng-disabled="vm.disabled()"
ng-class="vm.color()"

View File

@ -38,6 +38,11 @@
)
include history-templates/history-assigned-users
.diff-wrapper(
ng-if="vm.type == 'due_date'"
)
include history-templates/history-due-date
.diff-wrapper(
ng-if="vm.type == 'tags'"
)

View File

@ -0,0 +1,13 @@
.diff-status-wrapper
span.key(
translate="ACTIVITY.FIELDS.DUE_DATE"
)
span.diff(ng-if="vm.diff[0]") {{vm.diff[0] | momentFormat:'DD MMM YYYY'}}
span.diff(ng-if="!vm.diff[0]" translate="ACTIVITY.VALUES.NOT_SET")
tg-svg(
svg-icon="icon-arrow-right"
)
span.diff(ng-if="vm.diff[1]") {{vm.diff[1] | momentFormat:'DD MMM YYYY'}}
span.diff(ng-if="!vm.diff[1]" translate="ACTIVITY.VALUES.NOT_SET")

View File

@ -72,6 +72,14 @@ class UserTimelineItemTitle
if value == null && timeline.getIn(["data", "value_diff", "key"]) == 'assigned_to'
value = @translate.instant('ACTIVITY.VALUES.UNASSIGNED')
# due date
else if timeline.getIn(["data", "value_diff", "key"]) == 'due_date'
if value
prettyDate = @translate.instant("COMMON.PICKERDATE.FORMAT")
value = moment(value, "YYYY-MM-DD").format(prettyDate)
else
value = @translate.instant('ACTIVITY.VALUES.NOT_SET')
new_value = value
else
new_value = timeline.getIn(["data", "value_diff", "value"]).first().get(1)