Spaces:
Runtime error
Runtime error
File size: 495 Bytes
c4be319 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | function getPriorityEmoji(deadlineTime) {
if (!deadlineTime) return '';
const now = new Date();
const hoursLeft = (deadlineTime - now) / (1000 * 60 * 60);
if (hoursLeft < 0) {
return '💀'; // Overdue / Missed
} else if (hoursLeft <= 24) {
return '🔴'; // Less than 24 hours
} else if (hoursLeft <= 72) {
return '🟡'; // Less than 3 days
}
return '🟢'; // More than 3 days
}
module.exports = { getPriorityEmoji };
|