- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
You're close. But the script can still be shorter.
var nDay = new Date().getDate(),
r = "";
if (nDay == 1 || nDay == 21 || nDay == 31) {
r += "st";
} else if (nDay == 2 || nDay == 22) {
r += "nd";
} else if (nDay == 3 || nDay == 23) {
r += "rd";
} else {
r += "th";
}
this.rawValue = nDay + r;
Views
Replies
0 Likes
Total Likes