public static function get_array_days_by_repeated($year, $month, $week, $query, $elements)
 {
     $settings = unserialize(get_option("chronosly-settings"));
     if (!$month and !$week) {
         while ($query->have_posts()) {
             $query->the_post();
             if (is_array($elements["ids"]) and in_array(get_the_ID(), $elements["ids"])) {
                 continue;
             }
             //if the day is already done.
             $meta = get_post_meta(get_the_ID());
             if (isset($meta["ev-from"][0])) {
                 //Miramos cuando empieza y acaba y generamos sus repeticiones para ver si hay que mostrarlo
                 $start = strtotime($meta["ev-from"][0]);
                 $end = strtotime($meta["ev-to"][0]);
                 if ($settings["chronosly_week_start"] == 1) {
                     //$start -= (60*60*24);
                     //$end -= (60*60*24);
                 }
                 //do repeats
                 if (Post_Type_Chronosly::filter(get_the_ID())) {
                     $elements = Post_Type_Chronosly_Calendar::repeats($meta, $year, $month, $week, $start, $end, get_the_ID(), $elements, 1);
                 }
             }
         }
     } else {
         if ($week) {
             while ($query->have_posts()) {
                 $query->the_post();
                 if (is_array($elements["ids"]) and in_array(get_the_ID(), $elements["ids"])) {
                     continue;
                 }
                 //if the day is already done.
                 $meta = get_post_meta(get_the_ID());
                 if (isset($meta["ev-from"][0])) {
                     $start = strtotime($meta["ev-from"][0]);
                     $end = strtotime($meta["ev-to"][0]);
                     if ($settings["chronosly_week_start"] == 1) {
                         //  $start -= (60*60*24);
                         // $end -= (60*60*24);
                     }
                     //do repeats
                     if (Post_Type_Chronosly::filter(get_the_ID())) {
                         $elements = Post_Type_Chronosly_Calendar::repeats($meta, $year, $month, $week, $start, $end, get_the_ID(), $elements, 1);
                     }
                 }
             }
         } else {
             if ($month) {
                 while ($query->have_posts()) {
                     $query->the_post();
                     if (is_array($elements["ids"]) and in_array(get_the_ID(), $elements["ids"])) {
                         continue;
                     }
                     //if the day is already done.
                     $meta = get_post_meta(get_the_ID());
                     if (isset($meta["ev-from"][0])) {
                         $start = strtotime($meta["ev-from"][0]);
                         $end = strtotime($meta["ev-to"][0]);
                         if ($settings["chronosly_week_start"] == 1) {
                             //$start -= (60*60*24);
                             //$end -= (60*60*24);
                         }
                         if (Post_Type_Chronosly::filter(get_the_ID())) {
                             $elements = Post_Type_Chronosly_Calendar::repeats($meta, $year, $month, $week, $start, $end, get_the_ID(), $elements, 1);
                         }
                     }
                 }
             }
         }
     }
     return $elements;
 }