So I created a custom view.detail.php and I have code it that worked perfectly when testing in a logic hook. I getting the week number of one date and now and calulating the number of weeks from that..
PHP Code:
if(!empty($this->bean->fdc_date_online_one))
{
$week_online = date("W",strtotime($this->bean->fdc_date_online_one));
$week_now = date("W",time());
if($week_now < $week_online)
{
$weeks_online = ((52 - $week_online) + $week_now);
$this->bean->fdc_weeks_online_c = $weeks_onine;
}
$weeks_online = $week_now- $week_online;
$this->bean->fdc_weeks_online_c = $weeks_onine;
When the had the above code in a Logic Code it was giving me the Week Number of fdc_date_online_one. But in the detail view it is returning 01 for any date but it is returning the correct weel number of $week_now..
Any ideas of why this is happening?
Rgds
Chris
Bookmarks