Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions src/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function toFormattedDateString()
*
* @return string
*/
public function toFormattedDayDateString(): string
public function toFormattedDayDateString()
{
return $this->format('l j F Y');
}
Expand Down Expand Up @@ -68,6 +68,18 @@ public function toDateTimeString($unitPrecision = 'second')
return $this->format('Y/m/d ' . static::getTimeFormatByPrecision($unitPrecision));
}

/**
* Format the instance as a readable date and time
*
* @param string $unitPrecision
*
* @return string
*/
public function toFormattedDateTimeString($unitPrecision = 'second')
{
return $this->format('j F Y ' . static::getTimeFormatByPrecision($unitPrecision));
}

/**
* Return a format from H:i to H:i:s.u according to given unit precision.
*
Expand Down Expand Up @@ -110,11 +122,23 @@ public function toDateTimeLocalString($unitPrecision = 'second')
/**
* Format the instance with day, date and time
*
* @param string $unitPrecision
*
* @return string
*/
public function toDayDateTimeString($unitPrecision = 'second')
{
return $this->format('l j F Y ' . static::getTimeFormatByPrecision($unitPrecision));
}

/**
* Format the instance with the year, and a readable month
*
* @return string
*/
public function toDayDateTimeString()
public function toFormattedMonthYearString()
{
return $this->format('l j F Y g:i A');
return $this->format('F Y');
}

}