/** * @return XsDate */ public static function currentDate() { return XsDate::now(); }
/** * @param $value * @return XsDate */ public static function xsDate($value) { $value = XsDate::castToNodeValue($value); return XsDate::fromString($value); }
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'])); }
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]']); }