hello
I am using this code in order to show the date of payments in a Views Field:
<?php print date('D d-m-Y', $data->uc_payment_receipts_received); ?>
So... Is there any way to show the payments from TODAY? I mean, say to the code just to show payments from today, or this week....?

Thanks people

Javier

Comments

ravi.kumar88’s picture

In order to show payments from today or for this week you have to apply a Filter criteria.
Under the Filters add a new Global:PHP and under the filter code write the following code:

If you want to check whether $data->uc_payment_receipts_received is after today then do like this:

if (strtotome($data->uc_payment_receipts_received) > strtotime(date("Y-m-d")))
        return TRUE;
    else
        return FALSE;

If you want to check whether your date comes under this week then you can change the condition as
(strtotome($data->uc_payment_receipts_received) > strtotime(date("Y-m-d") && strtotome($data->uc_payment_receipts_received) < strtotime("+7 days"))

where date(Y-m-d) function returns the current date
and strtotime("+7 days") returns the timestamp of 7th day fro today's date.

Chris Matthews’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

The Drupal 6 branch is no longer supported, please check with the D6LTS project if you need further support. For more information as to why this issue was closed, please see issue #3030347: Plan to clean process issue queue