Morilog\Jalali\jDateTime::checkDate PHP Method

checkDate() public static method

Checks whether a date is valid or not.
public static checkDate ( $year, $month, $day, boolean $isJalali = true ) : boolean
$year
$month
$day
$isJalali boolean
return boolean
    public static function checkDate($year, $month, $day, $isJalali = true)
    {
        return $isJalali === true ? self::isValidateJalaliDate($year, $month, $day) : checkdate($month, $day, $year);
    }

Usage Example

示例#1
0
 public function testCheckDate()
 {
     $this->assertTrue(jDateTime::checkDate(1391, 2, 30, true));
     $this->assertFalse(jDateTime::checkDate(1395, 13, 10, true));
     $this->assertFalse(jDateTime::checkDate(1395, 12, 31, true));
     $this->assertFalse(jDateTime::checkDate(2015, 12, 31, true));
 }