Я надеюсь, что кто-нибудь сможет направить меня в правильном направлении. Я успешно извлекаю события, календари, несколько календарей и т. д. с помощью API календаря Google. Однако результаты отображаются каждый день любого месяца независимо от того, произошло ли фактическое событие или нет.
Какое поле мне нужно проверить, чтобы отсеять «дни без событий» или какой запрос мне нужен для фильтрации результатов?
Вот текущий PHP-массив параметров запроса, которые я использую:
$optParams = array(
'maxResults' => 100,
'orderBy' => 'startTime',
'singleEvents' => TRUE,
//'timeMin' => date('c'),
'timeMin' => date('c', strtotime('-30 days'))
);
Заранее спасибо!
Вот пример «пустого» события:
Google\Service\Calendar\Event Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[collection_key:protected] => recurrence
[anyoneCanAddSelf] =>
[attachmentsType:protected] => Google\Service\Calendar\EventAttachment
[attachmentsDataType:protected] => array
[attendeesType:protected] => Google\Service\Calendar\EventAttendee
[attendeesDataType:protected] => array
[attendeesOmitted] =>
[colorId] =>
[conferenceDataType:protected] => Google\Service\Calendar\ConferenceData
[conferenceDataDataType:protected] =>
[created] => 2022-04-29T17:19:37.000Z
[creatorType:protected] => Google\Service\Calendar\EventCreator
[creatorDataType:protected] =>
[description] =>
[endType:protected] => Google\Service\Calendar\EventDateTime
[endDataType:protected] =>
[endTimeUnspecified] =>
[etag] => "3412060797546000"
[eventType] => workingLocation
[extendedPropertiesType:protected] => Google\Service\Calendar\EventExtendedProperties
[extendedPropertiesDataType:protected] =>
[focusTimePropertiesType:protected] => Google\Service\Calendar\EventFocusTimeProperties
[focusTimePropertiesDataType:protected] =>
[gadgetType:protected] => Google\Service\Calendar\EventGadget
[gadgetDataType:protected] =>
[guestsCanInviteOthers] =>
[guestsCanModify] =>
[guestsCanSeeOtherGuests] =>
[hangoutLink] =>
[htmlLink] => https://www.google.com/calendar/event?e ... RpdmUuY29t
[iCalUID] => bm0tgo33bfuu2tbg77h8892rhc@google.com
[id] => bm0tgo33bfuu2tbg77h8892rhc_20240916
[kind] => calendar#event
[location] =>
[locked] =>
[organizerType:protected] => Google\Service\Calendar\EventOrganizer
[organizerDataType:protected] =>
[originalStartTimeType:protected] => Google\Service\Calendar\EventDateTime
[originalStartTimeDataType:protected] =>
[outOfOfficePropertiesType:protected] => Google\Service\Calendar\EventOutOfOfficeProperties
[outOfOfficePropertiesDataType:protected] =>
[privateCopy] =>
[recurrence] =>
[recurringEventId] => bm0tgo33bfuu2tbg77h8892rhc
[remindersType:protected] => Google\Service\Calendar\EventReminders
[remindersDataType:protected] =>
[sequence] => 0
[sourceType:protected] => Google\Service\Calendar\EventSource
[sourceDataType:protected] =>
[startType:protected] => Google\Service\Calendar\EventDateTime
[startDataType:protected] =>
[status] => confirmed
[summary] => Office
[transparency] => transparent
[updated] => 2024-01-23T17:19:58.773Z
[visibility] => public
[workingLocationPropertiesType:protected] => Google\Service\Calendar\EventWorkingLocationProperties
[workingLocationPropertiesDataType:protected] =>
[creator] => Google\Service\Calendar\EventCreator Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[displayName] => Gregg Moore
[email] => myemail@myemail.com
[id] =>
[self] => 1
)
[organizer] => Google\Service\Calendar\EventOrganizer Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[displayName] => Gregg Moore
[email] => myemail@myemail.com
[id] =>
[self] => 1
)
[start] => Google\Service\Calendar\EventDateTime Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[date] => 2024-09-16
[dateTime] =>
[timeZone] =>
)
[end] => Google\Service\Calendar\EventDateTime Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[date] => 2024-09-17
[dateTime] =>
[timeZone] =>
)
[originalStartTime] => Google\Service\Calendar\EventDateTime Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[date] => 2024-09-16
[dateTime] =>
[timeZone] =>
)
[reminders] => Google\Service\Calendar\EventReminders Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[collection_key:protected] => overrides
[overridesType:protected] => Google\Service\Calendar\EventReminder
[overridesDataType:protected] => array
[useDefault] =>
)
[workingLocationProperties] => Google\Service\Calendar\EventWorkingLocationProperties Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[customLocationType:protected] => Google\Service\Calendar\EventWorkingLocationPropertiesCustomLocation
[customLocationDataType:protected] =>
[homeOffice] =>
[officeLocationType:protected] => Google\Service\Calendar\EventWorkingLocationPropertiesOfficeLocation
[officeLocationDataType:protected] =>
[type] => officeLocation
[officeLocation] => Google\Service\Calendar\EventWorkingLocationPropertiesOfficeLocation Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[buildingId] =>
[deskId] =>
[floorId] =>
[floorSectionId] =>
[label] =>
)
)
)
Подробнее здесь: https://stackoverflow.com/questions/790 ... ing-events
API Календаря Google: запрос только существующих событий ⇐ Php
Кемеровские программисты php общаются здесь
-
Anonymous
1729096310
Anonymous
Я надеюсь, что кто-нибудь сможет направить меня в правильном направлении. Я успешно извлекаю события, календари, несколько календарей и т. д. с помощью API календаря Google. Однако результаты отображаются каждый день любого месяца независимо от того, произошло ли фактическое событие или нет.
Какое поле мне нужно проверить, чтобы отсеять «дни без событий» или какой запрос мне нужен для фильтрации результатов?
Вот текущий PHP-массив параметров запроса, которые я использую:
$optParams = array(
'maxResults' => 100,
'orderBy' => 'startTime',
'singleEvents' => TRUE,
//'timeMin' => date('c'),
'timeMin' => date('c', strtotime('-30 days'))
);
Заранее спасибо!
Вот пример «пустого» события:
Google\Service\Calendar\Event Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[collection_key:protected] => recurrence
[anyoneCanAddSelf] =>
[attachmentsType:protected] => Google\Service\Calendar\EventAttachment
[attachmentsDataType:protected] => array
[attendeesType:protected] => Google\Service\Calendar\EventAttendee
[attendeesDataType:protected] => array
[attendeesOmitted] =>
[colorId] =>
[conferenceDataType:protected] => Google\Service\Calendar\ConferenceData
[conferenceDataDataType:protected] =>
[created] => 2022-04-29T17:19:37.000Z
[creatorType:protected] => Google\Service\Calendar\EventCreator
[creatorDataType:protected] =>
[description] =>
[endType:protected] => Google\Service\Calendar\EventDateTime
[endDataType:protected] =>
[endTimeUnspecified] =>
[etag] => "3412060797546000"
[eventType] => workingLocation
[extendedPropertiesType:protected] => Google\Service\Calendar\EventExtendedProperties
[extendedPropertiesDataType:protected] =>
[focusTimePropertiesType:protected] => Google\Service\Calendar\EventFocusTimeProperties
[focusTimePropertiesDataType:protected] =>
[gadgetType:protected] => Google\Service\Calendar\EventGadget
[gadgetDataType:protected] =>
[guestsCanInviteOthers] =>
[guestsCanModify] =>
[guestsCanSeeOtherGuests] =>
[hangoutLink] =>
[htmlLink] => https://www.google.com/calendar/event?eid=Ym0wdGdvMzNiZnV1MnRiZzc3aDg4OTJyaGNfMjAyNDA5MTYgZ3JlZ2dAYmx1bW9vY3JlYXRpdmUuY29t
[iCalUID] => bm0tgo33bfuu2tbg77h8892rhc@google.com
[id] => bm0tgo33bfuu2tbg77h8892rhc_20240916
[kind] => calendar#event
[location] =>
[locked] =>
[organizerType:protected] => Google\Service\Calendar\EventOrganizer
[organizerDataType:protected] =>
[originalStartTimeType:protected] => Google\Service\Calendar\EventDateTime
[originalStartTimeDataType:protected] =>
[outOfOfficePropertiesType:protected] => Google\Service\Calendar\EventOutOfOfficeProperties
[outOfOfficePropertiesDataType:protected] =>
[privateCopy] =>
[recurrence] =>
[recurringEventId] => bm0tgo33bfuu2tbg77h8892rhc
[remindersType:protected] => Google\Service\Calendar\EventReminders
[remindersDataType:protected] =>
[sequence] => 0
[sourceType:protected] => Google\Service\Calendar\EventSource
[sourceDataType:protected] =>
[startType:protected] => Google\Service\Calendar\EventDateTime
[startDataType:protected] =>
[status] => confirmed
[summary] => Office
[transparency] => transparent
[updated] => 2024-01-23T17:19:58.773Z
[visibility] => public
[workingLocationPropertiesType:protected] => Google\Service\Calendar\EventWorkingLocationProperties
[workingLocationPropertiesDataType:protected] =>
[creator] => Google\Service\Calendar\EventCreator Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[displayName] => Gregg Moore
[email] => myemail@myemail.com
[id] =>
[self] => 1
)
[organizer] => Google\Service\Calendar\EventOrganizer Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[displayName] => Gregg Moore
[email] => myemail@myemail.com
[id] =>
[self] => 1
)
[start] => Google\Service\Calendar\EventDateTime Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[date] => 2024-09-16
[dateTime] =>
[timeZone] =>
)
[end] => Google\Service\Calendar\EventDateTime Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[date] => 2024-09-17
[dateTime] =>
[timeZone] =>
)
[originalStartTime] => Google\Service\Calendar\EventDateTime Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[date] => 2024-09-16
[dateTime] =>
[timeZone] =>
)
[reminders] => Google\Service\Calendar\EventReminders Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[collection_key:protected] => overrides
[overridesType:protected] => Google\Service\Calendar\EventReminder
[overridesDataType:protected] => array
[useDefault] =>
)
[workingLocationProperties] => Google\Service\Calendar\EventWorkingLocationProperties Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[customLocationType:protected] => Google\Service\Calendar\EventWorkingLocationPropertiesCustomLocation
[customLocationDataType:protected] =>
[homeOffice] =>
[officeLocationType:protected] => Google\Service\Calendar\EventWorkingLocationPropertiesOfficeLocation
[officeLocationDataType:protected] =>
[type] => officeLocation
[officeLocation] => Google\Service\Calendar\EventWorkingLocationPropertiesOfficeLocation Object
(
[internal_gapi_mappings:protected] => Array
(
)
[modelData:protected] => Array
(
)
[processed:protected] => Array
(
)
[buildingId] =>
[deskId] =>
[floorId] =>
[floorSectionId] =>
[label] =>
)
)
)
Подробнее здесь: [url]https://stackoverflow.com/questions/79086911/google-calendar-api-requesting-only-existing-events[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия