function es_get_workingSheduler_data($needle_date, $personal){
if( !isset($personal) || empty($personal) ) { $personal = es_getPersonal(); } // Проверям id
if( isset( $needle_date) && !empty($needle_date) ){ list($month, $year) = explode("-", $needle_date); }
else{ $month = date('m'); $year = date('Y'); } // Определяем дату
$data=[]; $actual_dates = array(); $actual_uid_dates=[];
// Формируем актуальные даты запрашиваемого месяца
$max_days = cal_days_in_month(CAL_GREGORIAN, date($month), date($year) );
for ($i=1; $i<$max_days+1; $i++) { if( $i <= 9 ){ $day = "0" . $i; } else { $day = $i; } array_push($actual_dates, "$year-$month-$day"); }
/*Остановился здесь. */
foreach ($personal as $uid) {
//$all_uid_dates[$uid] = get_user_meta($uid, 'sheduleGrafic', false);
$actual_uid_dates[$uid] = array_intersect_key( get_user_meta($uid, 'sheduleGrafic', false), array_flip($actual_dates) );
}
//wp_send_json($actual_uid_dates);
wp_send_json($all_uid_dates);
//foreach ($personal as $uid) { $actual_uid_dates[$uid] = array_replace($actual_dates, $all_uid_dates[$uid]); }
//wp_send_json($actual_uid_dates);
}