diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-05-05 09:11:19 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-05-05 09:11:19 +0400 |
commit | 757c78ea4a708d24c8264e4fc1ee94bdc9a700da (patch) | |
tree | 6ebd290e0439d17bb831e13760a87a8c11736682 /plugins/Annotations | |
parent | 0670900bde8339f45078d4cb9e4f9fb2fc51c8a7 (diff) |
fixes #4888 use today as default date for new annotations
Diffstat (limited to 'plugins/Annotations')
-rwxr-xr-x | plugins/Annotations/Controller.php | 2 | ||||
-rwxr-xr-x | plugins/Annotations/templates/_annotationList.twig | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/plugins/Annotations/Controller.php b/plugins/Annotations/Controller.php index 616da88ec1..9ea46d5680 100755 --- a/plugins/Annotations/Controller.php +++ b/plugins/Annotations/Controller.php @@ -10,6 +10,7 @@ namespace Piwik\Plugins\Annotations; use Piwik\API\Request; use Piwik\Common; +use Piwik\Date; use Piwik\Piwik; use Piwik\View; @@ -70,6 +71,7 @@ class Controller extends \Piwik\Plugin\Controller list($startDate, $endDate) = API::getDateRangeForPeriod($date, $period, $lastN); $view->startDate = $startDate->toString(); $view->endDate = $endDate->toString(); + $view->today = Date::today()->toString(); $dateFormat = Piwik::translate('CoreHome_ShortDateFormatWithYear'); $view->startDatePretty = $startDate->getLocalized($dateFormat); diff --git a/plugins/Annotations/templates/_annotationList.twig b/plugins/Annotations/templates/_annotationList.twig index 79f7f31c22..811f6c41a9 100755 --- a/plugins/Annotations/templates/_annotationList.twig +++ b/plugins/Annotations/templates/_annotationList.twig @@ -8,11 +8,11 @@ {% for annotation in annotations %} {% include "@Annotations/_annotation.twig" %} {% endfor %} - <tr class="new-annotation-row" style="display:none;" data-date="{{ startDate }}"> + <tr class="new-annotation-row" style="display:none;" data-date="{{ today }}"> <td class="annotation-meta"> <div class="annotation-star"> </div> <div class="annotation-period-edit"> - <a href="#">{{ startDate }}</a> + <a href="#">{{ today }}</a> <div class="datepicker" style="display:none;"/> </div> |