Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse date apram instead of timesteamp param #83

Open
wants to merge 3 commits into
base: 1.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/elements/db/SubscriptionQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -588,19 +588,21 @@ public function onTrial(?bool $value = true): SubscriptionQuery
/**
* Narrows the query results based on the subscriptions’ next payment dates.
*
* Values must be a unix timestamp.
*
* Possible values include:
*
* | Value | Fetches {elements}…
* | - | -
* | `'>= 2018-04-01'` | with a next payment on or after 2018-04-01.
* | `'< 2018-05-01'` | with a next payment before 2018-05-01
* | `['and', '>= 2018-04-04', '< 2018-05-01']` | with a next payment between 2018-04-01 and 2018-05-01.
* | `'>= 1522558800'` | with a next payment on or after 1522558800 (2018-04-01).
* | `'< 1525150800'` | with a next payment before 1525150800 (2018-05-01)
* | `['and', '>= 1522558800', '< 1525150800']` | with a next payment between 1522558800 (2018-04-01) and 1525150800 (2018-05-01).
*
* ---
*
* ```twig
* {# Fetch {elements} with a payment due soon #}
* {% set aWeekFromNow = date('+7 days')|atom %}
* {% set aWeekFromNow = date('+7 days')|date('U') %}
*
* {% set {elements-var} = {twig-method}
* .nextPaymentDate("< #{aWeekFromNow}")
Expand All @@ -609,7 +611,7 @@ public function onTrial(?bool $value = true): SubscriptionQuery
*
* ```php
* // Fetch {elements} with a payment due soon
* $aWeekFromNow = new \DateTime('+7 days')->format(\DateTime::ATOM);
* $aWeekFromNow = new \DateTime('+7 days')->getTimestamp()
*
* ${elements-var} = {php-method}
* ->nextPaymentDate("< {$aWeekFromNow}")
Expand Down
Loading