From b0d56587cb7e5a8059eec6e078bf15c86bc34bc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Wed, 10 Sep 2014 16:16:49 +0200 Subject: [PATCH] Fix bug #928: More robust sprint creation --- app/coffee/modules/backlog/lightboxes.coffee | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/coffee/modules/backlog/lightboxes.coffee b/app/coffee/modules/backlog/lightboxes.coffee index 728d6e99..a26f5d10 100644 --- a/app/coffee/modules/backlog/lightboxes.coffee +++ b/app/coffee/modules/backlog/lightboxes.coffee @@ -89,11 +89,17 @@ CreateEditSprint = ($repo, $confirm, $rs, $rootscope, lightboxService, $loading) $scope.sprint.project = projectId $scope.sprint.name = null $scope.sprint.slug = null - $scope.sprint.estimated_start = moment($scope.sprint.estimated_start).format("DD MMM YYYY") - $scope.sprint.estimated_finish = moment($scope.sprint.estimated_finish).format("DD MMM YYYY") + if $scope.sprint.estimated_start + $scope.sprint.estimated_start = moment($scope.sprint.estimated_start).format("DD MMM YYYY") + else + $scope.sprint.estimated_start = moment().format("DD MMM YYYY") + if $scope.sprint.estimated_finish + $scope.sprint.estimated_finish = moment($scope.sprint.estimated_finish).format("DD MMM YYYY") + else + $scope.sprint.estimated_finish = moment().format("DD MMM YYYY") lastSprintNameDom = $el.find(".last-sprint-name") - sprintName = $scope.sprints?[0].name + sprintName = $scope.sprints?[0]?.name if sprintName? lastSprintNameDom.html(" last sprint is #{sprintName} ;-) ")