Hi bjsteiger,
There are a bunch of ways to do it. One approach, using PHP (parsed on output):
<?php
//
// Format a date based on values taken from the URL
//
// Fetch the year and ensure it's legit
$year = '{segment_2}';
if (!is_numeric($year) || $year < 1900 || $year > 2100)
{
$year = date('Y');
// If the year isn't legit, we assume the month and day aren't legit either
$month = 1;
$day = 1;
}
else
{
// Fetch the month and ensure it's legit
$month = '{segment_3}';
if (!is_numeric($month) || $month < 1 || $month > 12)
{
$month = date('m');
// If the month isn't legit, we assume the day isn't legit either
$day = 1;
}
else
{
// Fetch the day and ensure it's legit
$day = ' {segment_4}';
$days_in_month = date('t', mktime(12, 0, 0, $month, 1, $year));
if (!is_numeric($day) || $day < 1 || $day > $days_in_month)
{
$day = 1;
}
}
}
// Output something like 'October 23rd'
echo date('F jS', mktime(12, 0, 0, $month, $day, $year));
?>