Answers for "how to find two date under how many mondays find in laravel corban"

PHP
0

how to find two date under how many mondays find in laravel corban

// its wrong methods 
$dateDay = \Carbon\Carbon::now();//use your date to get month and year
$now = Carbon::now(); // current date
$end = Carbon::parse("2020-11-22"); //insert date
$length = $end->diffInDays($now); //total days
$resultDays = array('Monday' => 0,'Tuesday' => 0,'Wednesday' => 0,'Thursday' => 0,'Friday' => 0,'Saturday' => 0,'Sunday' => 0);
// dd($end);
foreach($days as $key => $value)
{
  dd($value);

}
while($now <= $end)
{
  if($now->englishDayOfWeek == "Friday")
  {
    dd("dsfs");
  }

}
$year = $dateDay->year;
$month = $dateDay->month;
$days = $dateDay->daysInMonth;
$mondays=[];
foreach (range(1, $days) as $day) {
  $date = \Carbon\Carbon::createFromDate($year, $month, $day);
  if ($date->isMonday()===true) {
    $mondays[]=($date->day);
  }

}
dd($mondays);
//@sujay
Posted by: Guest on October-22-2020

Code answers related to "how to find two date under how many mondays find in laravel corban"

Browse Popular Code Answers by Language