Skip to content

Commit

Permalink
fix format_datetime when null use current
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomlove committed Jun 16, 2022
1 parent 0cf5696 commit c7b75b8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
8 changes: 2 additions & 6 deletions app/Console/Commands/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,8 @@ public function __construct()
*/
public function handle()
{
$arr = [
'uid' => 1,
'torrent_id' => 1,
'action_type' => 'ban',
];
TorrentOperationLog::query()->create($arr);
$r = Carbon::parse(null);
dd($r);
}


Expand Down
2 changes: 1 addition & 1 deletion include/constants.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.7.16');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-06-16');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2022-06-17');
defined('IN_TRACKER') || define('IN_TRACKER', true);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
Expand Down
3 changes: 3 additions & 0 deletions include/globalfunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,9 @@ function last_query($all = false)

function format_datetime($datetime, $format = 'Y-m-d H:i')
{
if (empty($datetime)) {
return '';
}
try {
$carbonTime = \Carbon\Carbon::parse($datetime);
return $carbonTime->format($format);
Expand Down

0 comments on commit c7b75b8

Please sign in to comment.