Skip to content

Commit

Permalink
Let schedule handle NULL for scheduled_at
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvandemaele authored Jun 8, 2020
1 parent ef5342a commit 396b872
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Skeleton/Transaction/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ public function unfreeze() {
* @access public
*/
public function schedule($time = null) {
if ($this->scheduled_at == '0000-00-00 00:00:00' OR $time === null) {
if (empty($this->scheduled_at) || empty($time)) {
$this->scheduled_at = date('Y-m-d H:i:s');
}

if (strtotime($this->scheduled_at) < strtotime($time, strtotime($this->scheduled_at))) {
$this->scheduled_at = date('Y-m-d H:i:s');
}

if ($time !== null) {
if (!empty($time)) {
$this->scheduled_at = date('Y-m-d H:i:s', strtotime($time, strtotime($this->scheduled_at)));
}

Expand Down

0 comments on commit 396b872

Please sign in to comment.