示例#1
0
 /**
  * @param $format
  * @param $date
  * @param $y
  * @param $m
  * @param $d
  * @param $h
  * @param $i
  * @param $s
  *
  * @dataProvider provideJDateTimeFormats
  */
 public function test_format_string_to_JDateTime($format, $date, $y, $m, $d, $h, $i, $s)
 {
     $j1 = JalaliParser::createJalaliFromFormat($format, $date, true);
     $j2 = JalaliParser::createJDateTimeFromFormat($format, $date);
     $j3 = new JDateTime($y, $m, $d, $h, $i, $s);
     $j4 = JDateTime::fromFormat($format, $date);
     $this->assertEquals($j3, $j1);
     $this->assertEquals($j3, $j2);
     $this->assertEquals($j3, $j4);
 }
示例#2
0
 /**
  * @param string $format
  * @param string $strDate
  *
  * @return static
  */
 public static function fromFormat($format, $strDate)
 {
     return JalaliParser::createJalaliFromFormat($format, $strDate);
 }
示例#3
0
 /**
  * @param $format
  * @param $date
  * @param $y
  * @param $m
  * @param $d
  * @dataProvider provideFormats
  */
 public function test_format_string_to_JalaliDate($format, $date, $y, $m, $d)
 {
     $j1 = JalaliParser::createJalaliFromFormat($format, $date);
     $j2 = new JalaliDate($y, $m, $d);
     $this->assertEquals($j1, $j2);
 }