[Chartjs]-Laravel determine the date from database if MONDAY-SUNDAY

0👍

You can use this array to determine the day name from day number

days_numbers = [
 0 => 'saturday',
 1 => 'sunday',
 2 => 'monday',
 3 => 'thuesday',
 4 => 'wednesday',
 5 => 'thursday',
 6 => 'friday',
];

you can use this for getting day index:

$day_index = fmod($day_number, 7);

Leave a comment