Hello, we are still a small community and we contribute and help in our spare time - and it was Christmas.
Your question:
It is possible, but you have to do multiple steps.
Create a collection with your fields.
If you don’t need numeric ids, you can use the default _id field with mongodb id style.
For start_date and end_date, you can use the date field. If you need the part 00:00:00 in your output, you can copy and paste the date field component file into path/to/cockpit/config/tags/field-date.tag and modifiy it to produce your exact date format. This way, the core component will be overwritten.
You can create your own api endpoint, that produces the format, you want. Create a file /cockpit/config/api/myCustomEndpoint.php and return your format.
Yes, it’s entirely possible to create a collection of calendar events that outputs JSON in the desired format. Below is an example of how you could structure your JSON:
{
“events”: [
{
“id”: 1,
“title”: “Meeting with Client”,
“start”: “2024-03-10T09:00:00”,
“end”: “2024-03-10T11:00:00”,
“location”: “Conference Room A”,
“description”: “Discuss project requirements and timelines.”
},
{
“id”: 2,
“title”: “Team Lunch”,
“start”: “2024-03-12T12:30:00”,
“end”: “2024-03-12T13:30:00”,
“location”: “Cafeteria”,
“description”: “Team building and bonding session.”
},
{
“id”: 3,
“title”: “Product Launch”,
“start”: “2024-03-15T10:00:00”,
“end”: “2024-03-15T12:00:00”,
“location”: “Main Auditorium”,
“description”: “Launch of new product line.”
}
]
}