nextcloud / calendar

📆 Calendar app for Nextcloud
https://apps.nextcloud.com/apps/calendar
GNU Affero General Public License v3.0
947 stars 231 forks source link

Unified Search API Response Update For Calendar Event #6079

Open alperozturk96 opened 1 week ago

alperozturk96 commented 1 week ago

We want to open calendar events directly in mobile application rather than redirect to web app. Therefore, we need to use Unified Search API to get calendar events and try to match with already synced internal calendar events by Dav5x. So that user can open calendar events in phone.

Dav5x ID and internal Android calendar ID is not matching for calendar events, so we need to provide uniqueness via depending on event name and event start date.

Unified Search API doesn't provide solid date information for the calendar events, we can only get formatted date as String in subline section. We can add createdAt inside the attributes as UNIX Timestamp so that we can have exact date inside the response, and we can compare with internal Android calendar events without parsing the formatted date string.

Current Implementation

{
"thumbnailUrl": "",
"title": "Event 1",
"subline": "Jan 13, 2021",
"resourceUrl": "http://localhost/nc/index.php/apps/calendar/edit/L25jL3JlbW90ZS5waHAvZGF2L2NhbGVuZGFycy90b2JpL3BlcnNvbmFsL0ZEOTI5NTNDLTE2MTYtNDhDOC04NUQ3LUM1Q0Y1RkY3Nzg5Mi5pY3M=",
"icon": "icon-calendar-dark",
"rounded": false,
"attributes": []
}

Suggestion

{
"thumbnailUrl": "",
"title": "Event 1",
"subline": "Jan 13, 2021",
"resourceUrl": "http://localhost/nc/index.php/apps/calendar/edit/L25jL3JlbW90ZS5waHAvZGF2L2NhbGVuZGFycy90b2JpL3BlcnNvbmFsL0ZEOTI5NTNDLTE2MTYtNDhDOC04NUQ3LUM1Q0Y1RkY3Nzg5Mi5pY3M=",
"icon": "icon-calendar-dark",
"rounded": false,
"attributes": [
"createdAt": 1719225231
]
}

Is the subline variable formatted according to the user's locale settings, or can we get a consistent format regardless of locale settings?