duebot-test / src /utils /priorityEmoji.js
Ali00922's picture
Upload 12 files
c4be319 verified
raw
history blame contribute delete
495 Bytes
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 };