Skip to content

Commit

Permalink
automatize dates
Browse files Browse the repository at this point in the history
  • Loading branch information
vanekm committed Aug 21, 2024
1 parent 723ed8d commit 646d792
Show file tree
Hide file tree
Showing 26 changed files with 179 additions and 238 deletions.
109 changes: 91 additions & 18 deletions app/Modules/Fykos/DefaultModule/DefaultPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,89 +73,162 @@ public function loadNews(): array
public function loadEventData(): void
{
$this->template->events = [
'DSEF' => [
'heading' => [
'cs' => 'DSEF',
'en' => 'DSEF' // Added English translation
],
'date' => date('Y-m-d H:i:s', strtotime('2024-10-21 09:00:00')),
'show-in-en' => false,
'is_series' => false,
'url' => 'https://dsef.cz',
'description' => [
'cs' => 'Den s experimentální fyzikou na Matfyzu',
'en' => 'Day with experimental physics at Matfyz'
],
'show-on-timeline' => true,
'logo_eventbox' => '/images/logos/dsef_symbol.svg',
],
'Naboj' => [
'heading' => [
'cs' => 'Fyzikální Náboj',
'en' => null
'en' => 'Physical Náboj' // Added English translation
],
'date' => date('Y-m-d H:i:s', strtotime('2024-11-15 09:00:00')),
'show-in-en' => false
],
'DSEF' => [
'heading' => [
'cs' => 'DSEF',
'en' => null
'show-in-en' => false,
'is_series' => false,
'url' => 'https://physics.naboj.org',
'description' => [
'cs' => 'Týmová soutěž v Praze, Ostravě a jinde ve světě',
'en' => 'Team competition in Prague, Ostrava, and elsewhere in the world'
],
'date' => date('Y-m-d H:i:s', strtotime('2024-10-21 09:00:00')),
'show-in-en' => false
'show-on-timeline' => true,
'logo_eventbox' => '/images/logos/naboj_symbol.svg',
],
'FOL' => [
'heading' => [
'cs' => 'Fyziklání Online',
'en' => 'Physics Brawl Online'
],
'date' => date('Y-m-d H:i:s', strtotime('2024-11-20 17:00:00')),
'show-in-en' => true
'show-in-en' => true,
'is_series' => false,
'url' => 'https://online.fyziklani.cz',
'description' => [
'cs' => 'Celosvětová soutěž, které se může účastnit každý',
'en' => 'Worldwide competition open to everyone'
],
'show-on-timeline' => true,
'logo_eventbox' => '/images/logos/fyziklani_online_symbol.svg'
],
'FOF' => [
'heading' => [
'cs' => 'Fyziklání',
'en' => 'Fyziklani'
],
'date' => date('Y-m-d H:i:s', strtotime('2025-02-14 10:30:00')),
'show-in-en' => true
'show-in-en' => true,
'is_series' => false,
'url' => 'https://fyziklani.cz',
'description' => [
'cs' => 'Největší týmová fyzikální soutěž v Evropě',
'en' => 'The largest team physics competition in Europe'
],
'show-on-timeline' => true,
'logo_eventbox' => '/images/logos/fyziklani_symbol.svg'
],
'serie-1' => [
'heading' => [
'cs' => 'Deadline 1. série',
'en' => 'Deadline Series 1'
],
'date' => date('Y-m-d H:i:s', strtotime('2024-10-06 23:59:59')),
'show-in-en' => true
'date' => date('Y-m-d H:i:s', strtotime('2024-10-06 23:59:59')),
'show-in-en' => true,
'is_series' => true,
'description' => [
'cs' => 'Rýže, kondenzátor a filodendron na cestě',
'en' => 'Rice, capacitor, and philodendron on the road'
],
'show-on-timeline' => true
],
'serie-2' => [
'heading' => [
'cs' => 'Deadline 2. série',
'en' => 'Deadline Series 2'
],
'date' => date('Y-m-d H:i:s', strtotime('2024-11-24 23:59:59')),
'show-in-en' => true
'show-in-en' => true,
'is_series' => true,
'description' => [
'cs' => 'Bitcoin, stromy a omrzování',
'en' => 'Bitcoin, trees, and cold exposure'
],
'show-on-timeline' => true
],
'serie-3' => [
'heading' => [
'cs' => 'Deadline 3. série',
'en' => 'Deadline Series 3'
],
'date' => date('Y-m-d H:i:s', strtotime('2025-01-12 23:59:59')),
'show-in-en' => true
'show-in-en' => true,
'is_series' => true,
'description' => [
'cs' => 'Chleba, starý zářič a aquapark',
'en' => 'Bread, radiation emitter, and water park'
],
'show-on-timeline' => true
],
'serie-4' => [
'heading' => [
'cs' => 'Deadline 4. série',
'en' => 'Deadline Series 4'
],
'date' => date('Y-m-d H:i:s', strtotime('2025-02-23 23:59:59')),
'show-in-en' => true
'show-in-en' => true,
'is_series' => true,
'description' => [
'cs' => 'Kouř, stín a raketou na zkoušku',
'en' => 'Smoke, shadow, and rocketing to an exam'
],
'show-on-timeline' => true
],
'serie-5' => [
'heading' => [
'cs' => 'Deadline 5. série',
'en' => 'Deadline Series 5'
],
'date' => date('Y-m-d H:i:s', strtotime('2025-03-30 23:59:59')),
'show-in-en' => true
'show-in-en' => true,
'is_series' => true,
'description' => [
'cs' => 'Čtverec, minigolf a vagon ve vesmíru',
'en' => 'Square, minigolf, and a wagon in space'
],
'show-on-timeline' => true
],
'serie-6' => [
'heading' => [
'cs' => 'Deadline 6. série',
'en' => 'Deadline Series 6'
],
'date' => date('Y-m-d H:i:s', strtotime('2025-05-11 23:59:59')),
'show-in-en' => true
'show-in-en' => true,
'is_series' => true,
'description' => [
'cs' => 'Akční film, ponorka a ořezávání tužky',
'en' => 'Action movie, submarine, and pencil sharpening'
],
'show-on-timeline' => true
]
];
$this->template->timelineBegin = date('Y-m-d', strtotime('2024-09-01'));
$this->template->timelineEnd = date('Y-m-d', strtotime('2025-05-31'));

// sort chronologically
// usort($this->template->events, function ($a, $b) {
// return strtotime($a['date']) - strtotime($b['date']);
// });
}

public function findCountdownEventIndices(array $events): array
Expand Down
Loading

0 comments on commit 646d792

Please sign in to comment.