Wow, I've spent 4 hours on this!
I wrote a UDT:
it returns the suffix.
BUT how do I pass the NUMBER of the day to the UDT???
UDT IS BELOW!
In my template, I just call it by name: {getSuffix}
any help--sooooo appreciated.
Code: Select all
{
$nn = $n % 100;
if ($nn > 3 && $nn < 21) {
return $n . 'th';
}
switch ($nn % 10) {
case '1': return $n . 'st';
case '2': return $n . 'nd';
case '3': return $n . 'rd';
default: return $n . 'th';
}
}
$list = '';
for ($n = 1; $n < 150; $n++) {
$list .= "$n: " . getEnglishOrdinalsuffix($n) . "\n";
}
print "<pre>$list</pre>";
Code: Select all
global $gCms;
$date = $event_date_start_day;
echo date('S');
I want it to use the day value from CALENDAR.
I tried $event_date_start_day and $day with no success.
How would I even pass these?
Can anyone help?