Only convert date if there's one

This commit is contained in:
2016-11-10 00:14:58 +01:00
parent 7d3a4cc630
commit dc85f81768

View File

@@ -284,8 +284,10 @@ function task_save(task_id, task_url) {
// NOTE: this is tightly linked to the HTML of the task list in for_project.jade.
$('.task-name-' + saved_task._id).text(saved_task.name).flashOnce();
$task.find('span.name').text(saved_task.name);
$task.find('span.due_date').text(moment().to(saved_task.properties.due_date));
$task.find('span.status').text(saved_task.properties.status.replace('_', ' '));
if (saved_task.properties.due_date){
$task.find('span.due_date').text(moment().to(saved_task.properties.due_date));
}
$task
.removeClassPrefix('status-')