I'll import (event) entries with feedme in craftcms 2 from an API who I'll can't change. The api gives the startdate off the events in a dateTime object. The allDay events have a date without time. Because the api also names those date elements different (start/dateTime, start/date) I'll have to import the data separate in to two fields for start and for end.
The question is how I'll get all those events (entries) together ordered by date? From the current date to the currentdate plus 6 months. The entries with the allDay date have an empty field for startDate and endDate and visa versa.
This is what I'll have but that didn't work.
'api/calendar' => function() {
// Fetch global set 'agenda'
return [
'elementType' => 'Entry',
'criteria' => [
'limit' => 0,
'startDate' => ['and', '>=' . date('U') . ""],
'endDate' => ['and', '<=' . date('U', strtotime("+6 months")) . ""],
'startDateAllDay' => ['and', '>=' . date('U') . ""],
'endDateAllDay' => ['and', '<=' . date('U', strtotime("+6 months")) . ""],
'order' => 'startDatum asc'
],