summaryrefslogtreecommitdiff
path: root/src/load-events.php
blob: b997fce9e3bc73df2af4eb72d44f7da25f3f0b3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
$events = [
    [
        'id' => 1,
        'title' => 'Évènement1',
        'start' => '2025-06-03T05:00:00Z', // Z indique que l'heure est en UTC
        'end' => '2025-06-03T09:00:00Z',
        'allDay' => false,
        'color' => '#ffa500', // couleur hexa, éviter les couleurs CSS qui ne fonctionnent pas dans value="" en HTML
        //'url' => 'https://dev.nageurs-bigoudens.fr', // comportement: https://fullcalendar.io/docs/eventClick
        'description' => 'blablabla',
    ],
    [
        'id' => 2,
        'title' => 'Évènement2',
        'start' => '2025-06-06T08:00:00Z',
        'end' => '2025-06-07T08:00:00Z',
        'allDay' => false,
        'color' => '#e01b24',
        'description' => 'truc machin',
    ],
    [
        'id' => 3,
        'title' => 'Évènement3',
        'start' => '2025-06-08',
        'end' => '2025-06-09',
        'allDay' => true, // pas d'heure
        'color' => '#008000',
        'description' => 'ça va chier',
    ],
    // provoque une erreur, si allDay la fin ne peut être égale au début
    /*[
        'id' => 4,
        'title' => 'Évènement4',
        'start' => '2025-06-09', 
        'end' => '2025-06-09',
        'allDay' => true,
        'color' => '#1a5fb4',
    ],*/
];

header('Content-Type: application/json');
echo json_encode($events);