I wonder if anyone could help me with this.
I have two fields in a database that are shown using:
1-<?php echo JHTML::_('date', $row->created_date, 'd/m/Y'); ?>
2-<?php echo $row->delivery_date; ?>
The first one, is written to the database as a full date with time, and as you can see above, I strip the output to only show the date. In the database it would appear as '2013-09-10 11:56:52'
The second is from a text entry form field, that has just text saved to the database in the format d/m/Y. In the database this appears as '19/09/2013'
Is there a way I can produce an if statement, that will add a span and class tag around the 2nd line if this condition is true:
"If the $row->delivery_date is within 21 days after (and including) $row->created_date."
Would it ultimately be best if I made them both full date values? Would that make it easier to calculate how many days apart they are?