Skip to content

Commit

Permalink
changed duedate from string to datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Zamponi committed Jul 19, 2017
1 parent 935206d commit 2d36e41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/Model/Interfaces/InvoiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ public function getInvoiceDate() : \DateTime;
public function setInvoiceDate(\DateTime $invoiceDate) : void;

/**
* @return string
* @return \DateTime
*/
public function getDueDate() : string;
public function getDueDate() : \DateTime;

/**
* @param string $dueDate
* @param \DateTime $dueDate
*/
public function setDueDate(string $dueDate) : void;
public function setDueDate(\DateTime $dueDate) : void;

/**
* @return string
Expand Down
12 changes: 6 additions & 6 deletions src/Model/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,19 +217,19 @@ public function setInvoiceDate(\DateTime $invoiceDate) : void
}

/**
* @return string
* @return \DateTime
*/
public function getDueDate() : string
public function getDueDate() : \DateTime
{
return $this->dueDate;
return \DateTime::createFromFormat('Y-m-d', $this->dueDate);
}

/**
* @param string $dueDate
* @param \DateTime $dueDate
*/
public function setDueDate(string $dueDate) : void
public function setDueDate(\DateTime $dueDate) : void
{
$this->dueDate = $dueDate;
$this->dueDate = $dueDate->format('Y-m-d');
}

/**
Expand Down

0 comments on commit 2d36e41

Please sign in to comment.