Skip to content

Commit

Permalink
Merge pull request #119 from alexdebril/issue/99
Browse files Browse the repository at this point in the history
Close #99
  • Loading branch information
alexdebril authored Sep 13, 2016
2 parents 1d54d30 + 5618429 commit bd59479
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions DependencyInjection/DebrilRssAtomExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function load(array $configs, ContainerBuilder $container)
'd M Y H:i:s P',
'D, d M Y H:i O',
'D, d M Y H:i:s O',
'D M d Y H:i:s e',
);

if (!isset($config['date_formats'])) {
Expand Down
2 changes: 2 additions & 0 deletions Protocol/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public function setDateFormats(array $dates)
*/
public function guessDateFormat($date)
{
$date = trim($date);
foreach ($this->dateFormats as $format) {
$test = \DateTime::createFromFormat($format, $date);
if ($test instanceof \DateTime) {
Expand Down Expand Up @@ -214,6 +215,7 @@ public function isValid(ItemInInterface $item, array $filters = array())
*/
public static function convertToDateTime($string, $format = \DateTime::RFC2822)
{
$string = trim($string);
$date = \DateTime::createFromFormat($format, $string);

if (!$date instanceof \DateTime) {
Expand Down

0 comments on commit bd59479

Please sign in to comment.