Esempio n. 1
0
File: Date.php Progetto: Samshal/xsl
 /**
  * @return XsDate
  */
 public static function currentDate()
 {
     return XsDate::now();
 }
Esempio n. 2
0
 /**
  * @param $value
  * @return XsDate
  */
 public static function xsDate($value)
 {
     $value = XsDate::castToNodeValue($value);
     return XsDate::fromString($value);
 }
Esempio 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']));
 }
Esempio 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]']);
 }