Introducing new responsive classes

This commit is contained in:
2017-09-26 13:01:10 +08:00
parent 6945834de5
commit 6c72ee9def
6 changed files with 23 additions and 95 deletions

View File

@@ -115,14 +115,14 @@
// returns a suffix string
// st, nd, rd, th
var getOrdinalSuffix = function(day)
var getOrdinalSuffix = function( day )
{
if (day < 4 || ( 20 < day && day < 24 )) {
if (day == 1 || day == 21) return "st";
else if (day == 2 || day == 22) return "nd";
else if (day == 3 || day == 23) return "rd";
}
else if (day == 31) return "st";
if( day < 1 || 31 < day )
throw new Error( "Day is out of range 1 <= day <= 31" );
if ( day == 1 || day == 21 || day == 31 ) return "st";
else if ( day == 2 || day == 22 ) return "nd";
else if ( day == 3 || day == 23 ) return "rd";
return "th";
};