Skip to content
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.

Commit

Permalink
Merge branch 'release/1.0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
kalebheitzman committed Jul 4, 2016
2 parents d1cf470 + 3df4a19 commit 97f1f6f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v1.0.4
## 07/04/2016
1 [](#bugfix)
* Fixed Issue #5 - Config not being called statically

# v1.0.3
## 05/13/2016
1 [](#bugfix)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Date tools plugin for Grav CMS

*This plugin works with Grav v1.1.0-rc.3 and above.*

This [Grav](http://getgrav.org) plugin provides date tools to use inside of Twig for filtering pages. With the release of Grav 0.9.13 `startDate` and `endDate` were introduced to collection parsing. You can use the following `datetools` to set various dates for retrieving [collections.](http://learn.getgrav.org/content/collections)

## Configuration
Expand Down
7 changes: 2 additions & 5 deletions classes/datetools.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,10 @@ class DateTools
/**
* Construct
*/
public function __construct( $grav )
public function __construct( $args )
{
// get grav
$this->grav = $grav;

// get the config
$this->config = $this->grav['config'];
$this->config = $args['config'];

// date format
$this->dateFormat = $this->config->get('plugins.datetools.dateFormat.default');
Expand Down
5 changes: 4 additions & 1 deletion datetools.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ public function onTwigSiteVariables()
{
require_once __DIR__ . '/classes/datetools.php';

$args = [];
$args['config'] = $this->grav['config'];

$twig = $this->grav['twig'];
$twig->twig_vars['datetools'] = new DateTools($this->grav);
$twig->twig_vars['datetools'] = new DateTools($args);
}

}

0 comments on commit 97f1f6f

Please sign in to comment.