Skip to content
This repository has been archived by the owner on Nov 11, 2020. It is now read-only.

Commit

Permalink
Merge branch '1.2.x'
Browse files Browse the repository at this point in the history
* 1.2.x:
  Update changelog for 1.2.2 release
  Fix wrong syntax for dateToString operator
  Hello 2016
  • Loading branch information
alcaeus committed Mar 19, 2016
2 parents c37bb60 + 9fa84e2 commit 2c10a6f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG-1.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ CHANGELOG for 1.2.x
This changelog references the relevant changes (bug and security fixes) done
in 1.2.x patch versions.

1.2.2 (2016-03-19)
------------------

* [#250](https://github.com/doctrine/mongodb/pull/250): Fix wrong syntax for dateToString operator

1.2.1 (2015-11-24)
------------------

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2006-2012 Doctrine Project
Copyright (c) 2006-2016 Doctrine Project

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/MongoDB/Aggregation/Expr.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ private function ensureArray($expression)
*/
public function dateToString($format, $expression)
{
return $this->operator('$dateToString', array($format, $expression));
return $this->operator('$dateToString', array('format' => $format, 'date' => $expression));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Doctrine/MongoDB/Tests/Aggregation/ExprTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function testDateToString()
$expr = new Expr();

$this->assertSame($expr, $expr->dateToString('%Y-%m-%d', '$dateField'));
$this->assertSame(array('$dateToString' => array('%Y-%m-%d', '$dateField')), $expr->getExpression());
$this->assertSame(array('$dateToString' => array('format' => '%Y-%m-%d', 'date' => '$dateField')), $expr->getExpression());
}

public function testDayOfMonth()
Expand Down

0 comments on commit 2c10a6f

Please sign in to comment.