Ejemplo n.º 1
0
Archivo: Date.php Proyecto: Samshal/xsl
 /**
  * @return XsDate
  */
 public static function currentDate()
 {
     return XsDate::now();
 }
Ejemplo n.º 2
0
 /**
  * @param $value
  * @return XsDate
  */
 public static function xsDate($value)
 {
     $value = XsDate::castToNodeValue($value);
     return XsDate::fromString($value);
 }
Ejemplo n.º 3
0
 public function testJanuaryFirst2017()
 {
     $xsDate = XsDate::fromString('2017-01-01');
     $this->assertEquals('01-01-2017', $this->transformFile('Stubs/Xsl/Formatting/format-date.xsl', ['date' => (string) $xsDate, 'picture' => '[D]-[M]-[Y]', 'language' => 'nl']));
 }
Ejemplo n.º 4
0
 public function testFormatDateNoTimeMarker()
 {
     $this->setExpectedException(InvalidArgumentException::class);
     $xsDate = XsDate::fromString('2015-10-16');
     $this->transformFile('Stubs/Xsl/Formatting/format-date.xsl', ['date' => (string) $xsDate, 'picture' => '[P]']);
 }