FlightGear wiki:Instant-Refs: Difference between revisions

Jump to navigation Jump to search
m
Fix issue whereby it would output "11st".
m (Fix issue whereby it would output "11st".)
Line 405: Line 405:
// Returns the correct ordinal adjective
// Returns the correct ordinal adjective
function ordAdj(date){
function ordAdj(date){
date = date.toString().substr(1);  
date = date.toString();
if(date == "1"){
if(date == "11" || date == "12" || date == "13"){
return "th";
}else if(date.substr(1) == "1"){
return "st";
return "st";
}else if(date == "2"){
}else if(date.substr(1) == "2"){
return "nd";
return "nd";
}else if(date == "3"){
}else if(date.substr(1) == "3"){
return "rd";
return "rd";
}else{
}else{

Navigation menu