Skip to content

Commit

Permalink
Merge branch 'q30t-master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLoy committed Nov 25, 2020
2 parents bd77b9b + 9c9a5dd commit 4d060f4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ $ npm install simplycountdown.js
minutes: 0, // Default is 0 [0-59] integer
seconds: 0, // Default is 0 [0-59] integer
words: { //words displayed into the countdown
days: 'day',
hours: 'hour',
minutes: 'minute',
seconds: 'second',
pluralLetter: 's'
days: { singular: 'day', plural: 'days' },
hours: { singular: 'hour', plural: 'hours' },
minutes: { singular: 'minute', plural: 'minutes' },
seconds: { singular: 'second', plural: 'seconds' }
},
plural: true, //use plurals
inline: false, //set to true to get an inline basic countdown like : 24 days, 4 hours, 2 minutes, 5 seconds
Expand Down
33 changes: 16 additions & 17 deletions dev/simplyCountdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,10 @@
minutes: 0,
seconds: 0,
words: {
days: 'day',
hours: 'hour',
minutes: 'minute',
seconds: 'second',
pluralLetter: 's'
days: { singular: 'day', plural: 'days' },
hours: { singular: 'hour', plural: 'hours' },
minutes: { singular: 'minute', plural: 'minutes' },
seconds: { singular: 'second', plural: 'seconds' }
},
plural: true,
inline: false,
Expand Down Expand Up @@ -211,25 +210,25 @@

if (parameters.plural) {
dayWord = days > 1
? parameters.words.days + parameters.words.pluralLetter
: parameters.words.days;
? parameters.words.days.plural
: parameters.words.days.singular;

hourWord = hours > 1
? parameters.words.hours + parameters.words.pluralLetter
: parameters.words.hours;
? parameters.words.hours.plural
: parameters.words.hours.singular;

minuteWord = minutes > 1
? parameters.words.minutes + parameters.words.pluralLetter
: parameters.words.minutes;
? parameters.words.minutes.plural
: parameters.words.minutes.singular;

secondWord = seconds > 1
? parameters.words.seconds + parameters.words.pluralLetter
: parameters.words.seconds;
? parameters.words.seconds.plural
: parameters.words.seconds.singular;
} else {
dayWord = parameters.words.days;
hourWord = parameters.words.hours;
minuteWord = parameters.words.minutes;
secondWord = parameters.words.seconds;
dayWord = parameters.words.days.singular;
hourWord = parameters.words.hours.singular;
minuteWord = parameters.words.minutes.singular;
secondWord = parameters.words.seconds.singular;
}

/* display an inline countdown into a span tag */
Expand Down
4 changes: 2 additions & 2 deletions 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 4d060f4

Please sign in to comment.