Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
ravi.kumar88 CreditAttribution: ravi.kumar88 commentedIn 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 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.
Comment #2
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 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