DateItems to the nth

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Post by sturgis » Wed Apr 01, 2009 5:23 am

Thats cool too. Actually think I have a clue how it does it too, which is a miracle. :D

I have been learning so much here on the forums, thx much all.

Could also do this as below, but no real improvement.

Code: Select all

function datesuffix n
	put "th" into mysuffix
	if n is among "1,2,3,21,22,23" then
		put item n mod 10 of "st,nd,rd" into mysuffix
	end if
	return mysuffix
end datesuffix
Think i'm starting to love rev. Proposed, but it said no. *sigh*

Post Reply