Loading...
 
Features / Usability

Features / Usability


Long Date Format in Trackers

posts: 758 United States

Using drop down select date or date picker, is it possible to have the long date format display in a pretty tracker?
Thank you folks for any help.


posts: 758 United States

Boy thanks Bernard that may have answered my question, so per that link you shot me too, if I use this in my pretty tracker template:

Copy to clipboard
{$f_lastmodif|tiki_short_date} will display human readable date only. {$f_lastmodif|tiki_short_datetime} will display human readable date and time.


Then I would just need to replace short with long correct?

posts: 758 United States

Thanks Bernard, I understand the General Settings date formats, the problem is getting a long date such as May 22, 2018 to show up in a pretty template, I am having a hard time to get that to show, if you see this link https://thepatriotwoodwiki.org/College-of-the-Redwoods you'll see in the infobox "Established" will only show "short date", getting the long date to display is complicated.
Would you know the code or string I need to have for the long date to display?


posts: 758 United States
So far I have been unable to get this to work, it seems a long date format should be able to display in tracker view and pretty tracker template. Can anyone point me to some documentation with an example of long date display for tracker? It may not exist, but if anyone has a working sample that would be nice too, thanks!
posts: 758 United States
Well thank you Bernard, that is very nice of you!

posts: 8633 Israel

Hi John,

I tested a bit.
As the doc says (and I ;) ) {$f_lastmodif|tiki_short_date} will display Tiki date based on your setting at tiki-admin.php?page=general: "tiki-admin.php?page=general".

You can then customise this how you want based on:
https://doc.tiki.org/Date-and-Time#Date_and_Time_Formats
http://php.net/manual/en/function.strftime.php

I was a bit disappointed at my first try because of the Tiki cache but I confirm you it is working fine and like the doc say on Tiki 18.x.

Just don;t forget to refresh Tiki caches after saving your template.

Hope this help


posts: 758 United States
Thank you Bernard, so with this {$f_lastmodif|tiki_short_date} does it understand which tracker field id to grab onto?
posts: 8633 Israel

{$f_lastmodif} is the tracker item last modification date and {$f_created} is for the item creation (again check the doc because it is there and may have a typo error here).

If you want to display a date from a field I would try the same modifier in the tag.
IE: {$f_1|tiki_short_date}

I guess it should be a date type field.
Never used it that way so I can’t confirm, but try your luck. :-)