When creating a date field in the catalog, is it possible to have it display the age of a person instead of the date?
When creating a date field in the catalog, is it possible to have it display the age of a person instead of the date?
You can use the version 2.0 Alpha and then add a Calculated field, but you'll have to know SQL to be able to write your age calculation from the birthday.
birthdate = 124315315 (let's say its 1969-10-20)
age = (-TIMESTAMPDIFF(YEAR, CURDATE(),DATE(FROM_UNIXTIME(birthdate))))
Thanks! I'll give it a go
Could you use SQL to display the date like this: Monday 1st January 2010?
This would be great for displaying dates in a catalogue i have for some courses.
I was able to turn the Unix time from the catalog date picker to display the date like this: Monday 1st April 2010.
I did this by adding some php to the template
This is the usual echo code:
<?php echo $entry['data']['service_date_date'']['value'];?>
service_date_date being the name of the catlogue field
I changed it to this:
<?php echo date("l jS F Y", $entry['data']['service_date_date']['value']);?>
Other things you can do can be found here: http://php.net/manual/en/function.date.php
I'm not a developer so can't explain more than this. hope someone else finds it useful.
Hey Ben
Now you're just being silly. The Catalog has always included the ability to format a date. Just enable formatting and then select DATE and then choose the date string. Its automated!
Dear god!
I'm sure I even knew this. There's just to many features in typolight and it's modules to remember.
Bookmarks