fix bug periode
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Helpers;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class PeriodeHelper
|
||||
{
|
||||
public static function getPeriodeRange($month, $year)
|
||||
{
|
||||
$month = (int) date('m', strtotime($month));
|
||||
$year = (int) $year;
|
||||
|
||||
// Jika Januari, periode dimulai dari 11 Januari hingga 10 Februari
|
||||
$start = Carbon::create($year, $month, 11)->startOfDay();
|
||||
$end = $start->copy()->addMonth()->subDay()->endOfDay();
|
||||
|
||||
return [$start, $end];
|
||||
}
|
||||
}
|
||||
@@ -249,7 +249,6 @@ class WhatsappHelper
|
||||
return $response->getBody()->getContents();
|
||||
} catch (\Exception $e) {
|
||||
AuditTrailHelper::AddAuditTrail('Error', 'Failed to send WhatsApp message at Form (' . $expense_number . ')');
|
||||
dd($e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user