Skip to content

Commit

Permalink
DateFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Menshenin committed Feb 4, 2017
1 parent 3a2c953 commit 320ef7e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions filters/DateFilter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
namespace pastuhov\logstock\filters;

/**
* Class for filtering dates in ISO 8601 format (date('c'))
*
* @package pastuhov\logstock\filters
*/
class DateFilter extends RegexpFilter
{
/**
* @var array
*/
public $patterns = [
'/\'\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+\d{2}:\d{2}\'/',
];

/**
* @var array
*/
public $replacement = [
':DATE',
];
}

0 comments on commit 320ef7e

Please sign in to comment.