Example #1
0
File: Date.php Project: Samshal/xsl
 /**
  * @return XsTime
  */
 public static function currentTime()
 {
     return XsTime::now();
 }
Example #2
0
 /**
  * @param $value
  * @return XsTime
  */
 public static function xsTime($value)
 {
     $value = XsTime::castToNodeValue($value);
     return XsTime::fromString($value);
 }
Example #3
0
 public function testTimeLanguage()
 {
     $xsTime = XsTime::fromString('15:37:00');
     $this->assertEquals('15:37:00', $this->transformFile('Stubs/Xsl/Formatting/format-time.xsl', ['time' => (string) $xsTime, 'picture' => '[H]:[m]:[s]', 'language' => 'en']));
 }
Example #4
0
 public function testFormatTimeNoDayOfWeek()
 {
     $this->setExpectedException(InvalidArgumentException::class);
     $xsTime = XsTime::fromString('09:37:00');
     $this->transformFile('Stubs/Xsl/Formatting/format-time.xsl', ['time' => (string) $xsTime, 'picture' => '[F]']);
 }