Skip to content

Commit

Permalink
Add inlineSeparator feature
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLoy committed Dec 5, 2024
1 parent 3e560ab commit f22d9a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions dev/simplyCountdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
},
plural: true,
inline: false,
inlineSeparator: ', ',
enableUtc: false,
onEnd: () => {
},
Expand Down Expand Up @@ -247,15 +248,15 @@
let displayStr = '';

if (!(parameters.removeZeroUnits && days === 0)) {
displayStr += `${days} ${dayWord}, `;
displayStr += `${days} ${dayWord}${parameters.inlineSeparator}`;
}

if (!(parameters.removeZeroUnits && days === 0 && hours === 0)) {
displayStr += `${hours} ${hourWord}, `;
displayStr += `${hours} ${hourWord}${parameters.inlineSeparator}`;
}

if (!(parameters.removeZeroUnits && days === 0 && hours === 0 && minutes === 0)) {
displayStr += `${minutes} ${minuteWord}, `;
displayStr += `${minutes} ${minuteWord}${parameters.inlineSeparator}`;
}

// Seconds should always be displayed
Expand Down
2 changes: 1 addition & 1 deletion dist/simplyCountdown.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f22d9a5

Please sign in to comment.