I want to create a countdown kinda thing in my app, the column ‘end_date‘ is in DATETIME format. if i use:
echo $thing['table_name']['end_date']
output is(todays’ date):
2012-08-16
where as i want the output to be:
3 days left
now how can i do this? i’ll be using this in a lot of different views, i found this tutorial but i’d have to put this code again and again. i wanna solve this with a more OOP approach. Is it possible to put this in the Model directly or something of that sort?
Any direction would be of great help. 🙂
You should use virtualFields in this case
now you will get this field under
echo $thing['table_name']['timeleft']