Skip to content

Commit

Permalink
readability: convert months into years if full years
Browse files Browse the repository at this point in the history
  • Loading branch information
BarryCarlyon committed May 8, 2024
1 parent af3af37 commit f5b2f22
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions eventsub/websockets/web/activity_feed/feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,16 @@ function runLineNotification({ payload }) {
var cell = r.insertCell();
cell.textContent = `Resub ${processTier(sub_tier)}`;
var cell = r.insertCell();

let durational = `${cumulative_months} months`;
if (cumulative_months % 12 === 0) {
durational = `${cumulative_months / 12} years`;
}

if (streak_months) {
cell.textContent = `${cumulative_months} months for ${streak_months} streak`;
cell.textContent = `${durational} for ${streak_months} streak`;
} else {
cell.textContent = `${cumulative_months} months`;
cell.textContent = `${durational}`;
}

var cell = r.insertCell();
Expand Down

0 comments on commit f5b2f22

Please sign in to comment.