Fix suffixes.

This commit is contained in:
ccd0 2015-01-24 11:08:26 -08:00
parent 6d2a3dfefb
commit fb0a4c51f5
3 changed files with 6 additions and 3 deletions

View File

@ -13655,7 +13655,7 @@
},
markNew: function(post, ipCount) {
var counter, suffix;
suffix = ['st', 'nd', 'rd'][ipCount % 10] || 'th';
suffix = (Math.floor(ipCount / 10)) % 10 === 1 ? 'th' : ['st', 'nd', 'rd'][ipCount % 10 - 1] || 'th';
counter = $.el('span', {
className: 'ip-counter',
textContent: "(" + ipCount + ")"

View File

@ -13678,7 +13678,7 @@
},
markNew: function(post, ipCount) {
var counter, suffix;
suffix = ['st', 'nd', 'rd'][ipCount % 10] || 'th';
suffix = (Math.floor(ipCount / 10)) % 10 === 1 ? 'th' : ['st', 'nd', 'rd'][ipCount % 10 - 1] || 'th';
counter = $.el('span', {
className: 'ip-counter',
textContent: "(" + ipCount + ")"

View File

@ -32,7 +32,10 @@ MarkNewIPs =
MarkNewIPs.postIDs = postIDs
markNew: (post, ipCount) ->
suffix = ['st', 'nd', 'rd'][ipCount % 10] or 'th' # fuck switches
suffix = if (ipCount // 10) % 10 is 1
'th'
else
['st', 'nd', 'rd'][ipCount % 10 - 1] or 'th' # fuck switches
counter = $.el 'span',
className: 'ip-counter'
textContent: "(#{ipCount})"