fix strict type set date
This commit is contained in:
1 parent
e0b5628976
commit
8ecabc5a5e
5 files changed
+14
-12
No files matched your search
@@ -229,7 +229,7 @@ trait Accessor
|
||||
*/
|
||||
public function setDateTime($year, $month, $day, $hour, $minute, $second = 0, $microseconds = 0)
|
||||
{
|
||||
return $this->setDate($year, $month, $day)->setTime($hour, $minute, $second, $microseconds);
|
||||
return $this->setDateJalali($year, $month, $day)->setTime($hour, $minute, $second, $microseconds);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -242,12 +242,13 @@ trait Accessor
|
||||
*
|
||||
* @return Verta
|
||||
*/
|
||||
public function setDate($year, $month, $day)
|
||||
public function setDateJalali($year, $month, $day)
|
||||
{
|
||||
list($year, $month, $day) = self::getGregorian($year, $month, $day);
|
||||
|
||||
parent::setDate($year, $month, $day);
|
||||
|
||||
if(static::isValidDate($year, $month, $day)) {
|
||||
parent::setDate($year, $month, $day);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -268,8 +269,9 @@ trait Accessor
|
||||
$minute = $time[1] ?? 0;
|
||||
$second = $time[2] ?? 0;
|
||||
|
||||
parent::setTime($hour, $minute, $second, 0);
|
||||
|
||||
if(static::isValidTime($hour, $minute, $second)) {
|
||||
parent::setTime($hour, $minute, $second, 0);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -133,7 +133,7 @@ trait Boundaries
|
||||
{
|
||||
$month = $this->quarter * static::MONTHS_PER_QUARTER;
|
||||
|
||||
return $this->setDate($this->year, $month, 1)->endMonth();
|
||||
return $this->setDateJalali($this->year, $month, 1)->endMonth();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user