Page MenuHomePhabricator

Some deadline stamps change color, while others do not, despite having the same deadline
Closed, DeclinedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Set 2 tasks to have the same deadline, 1+ week in advance

What happens?:

image.png (360×310 px, 16 KB)

What should have happened instead?:

  • I would expect tasks with the same deadline to have the same color stamp

Event Timeline

Aklapper closed this task as Declined.EditedJun 8 2023, 4:39 PM

Custom code in rPHEX's src/customfields/DeadlineEditEngineSubtype.php to colorize is not based on calendar days in some timezone but on seconds:

$due = $deadline->getValueForStorage();
$now = time();
$day = 86400;
if ($due < $now) {
  $this->setColor('fire');
} else if ($due < $now + ($day * 2.5)) {
  $this->setColor('orange');
} else if ($due < $now + ($day * 7)) {
  $this->setColor('green');
} else {
  $this->setColor('grey');

SELECT oldValue, newValue, objectPHID FROM maniphest_transaction WHERE (objectPHID = "PHID-TASK-gtshisfvq7ex5m7gxjqh" OR objectPHID = "PHID-TASK-6cc7in5vjbpjuduiak5x") AND metadata LIKE "%deadline%"; shows that

  • 311075 had the Due Date epoch 1656486000 = Wed Jun 29 2022 07:00:00 GMT+0000
  • 298661 had the Due Date epoch 1656561600 = Thu Jun 30 2022 04:00:00 GMT+0000

Boldly assuming you've set your timezone in https://phabricator.wikimedia.org/settings/panel/datetime/ and that your timezone is between GMT-7 and GMT-5 and given the task due dates being 21 hours apart, I'd say that code works correctly.

It would probably be more obvious if we also rendered the Due Time and not only the Due Date but space is limited...