From bc20b198b527e4994e6b03bd332f90cb7fd45243 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 13 Feb 2019 01:10:14 +0000 Subject: [PATCH] Use timestamps for talk dates --- .../building-static-websites-sculpin.md | 2 +- .../configuring-all-the-things-drupal-8.md | 3 +- source/_talks/dancing-for-drupal.md | 2 +- source/_talks/deploying-drupal-fabric.md | 4 +- .../deploying-php-ansible-ansistrano.md | 2 +- source/_talks/deploying-php-fabric.md | 6 +-- source/_talks/drupal-8-module-development.md | 2 +- .../drupal-8-php-libraries-drupalorg-api.md | 4 +- source/_talks/drupal-8-rejoining-the-herd.md | 2 +- source/_talks/drupal-8.md | 2 +- source/_talks/drupal-vm-generator.md | 4 +- .../_talks/drupal-vm-meet-symfony-console.md | 2 +- source/_talks/drupalorg-2015.md | 4 +- source/_talks/drush-make-drupalbristol.md | 2 +- .../_talks/getting-your-data-into-drupal-8.md | 4 +- source/_talks/git-flow.md | 2 +- .../goodbye-drush-make-hello-composer.md | 4 +- source/_talks/it-all-started-with-a-patch.md | 2 +- ...modern-drupal-development-with-composer.md | 2 +- source/_talks/so-what-is-this-drupal-thing.md | 2 +- .../_talks/taking-flight-with-tailwind-css.md | 4 +- source/_talks/tdd-test-driven-drupal.md | 12 +++--- source/_talks/test-drive-twig-with-sculpin.md | 2 +- ...md => things-you-should-know-about-php.md} | 2 +- ...ing-laravel-collections-outside-laravel.md | 4 +- source/talks.html.twig | 8 ++-- .../TwigExtension/TalksExtension.php | 2 +- .../TwigExtension/FormatTalksTest.php | 38 +++++++++---------- 28 files changed, 65 insertions(+), 64 deletions(-) rename source/_talks/{2019-01-28-things-you-should-know-about-php.md => things-you-should-know-about-php.md} (93%) diff --git a/source/_talks/building-static-websites-sculpin.md b/source/_talks/building-static-websites-sculpin.md index 2d76eb8d9..99bc91b86 100644 --- a/source/_talks/building-static-websites-sculpin.md +++ b/source/_talks/building-static-websites-sculpin.md @@ -12,7 +12,7 @@ youtube: id: aN53arCKZAU events: - event: phpsw - date: '2015-10-14' + date: 2015-10-14 joindin: https://joind.in/talk/view/15486 --- [Sculpin][0] is a static site generator written in PHP. It converts Markdown files, Twig templates and standard HTML into a static HTML site that can be easily deployed. diff --git a/source/_talks/configuring-all-the-things-drupal-8.md b/source/_talks/configuring-all-the-things-drupal-8.md index c8b4af34d..61d0bdcaa 100644 --- a/source/_talks/configuring-all-the-things-drupal-8.md +++ b/source/_talks/configuring-all-the-things-drupal-8.md @@ -10,6 +10,7 @@ tags: - drupal - drupal-8 events: - - { event: drupal_bristol, date: '2018-07-25' } + - event: drupal_bristol + date: 2018-07-25 --- A short notice talk on configuration management in Drupal 8, and things I’ve learned working on my current Drupal 8 project. diff --git a/source/_talks/dancing-for-drupal.md b/source/_talks/dancing-for-drupal.md index dfe4a7cb8..c4339f2ef 100644 --- a/source/_talks/dancing-for-drupal.md +++ b/source/_talks/dancing-for-drupal.md @@ -8,7 +8,7 @@ tags: [meetup, umbristol, drupal] tweets: yes events: - event: umbristol - date: '2015-08-25' + date: 2015-08-25 --- As part of their [CMS Dance-Off][1], I was selected to speak about Drupal alongside other speakers representing Umbraco, Sitecore and Episerver. diff --git a/source/_talks/deploying-drupal-fabric.md b/source/_talks/deploying-drupal-fabric.md index a51abddea..1882c0bae 100644 --- a/source/_talks/deploying-drupal-fabric.md +++ b/source/_talks/deploying-drupal-fabric.md @@ -14,10 +14,10 @@ meta: type: website events: - event: drupalcamp_dublin_17 - date: '2017-10-20' + date: 2017-10-20 time: '15:00 - 15:40' - event: drupal_somerset - date: '2017-10-26' + date: 2017-10-26 --- You’ve built your website, and now you just need to deploy it. There are various ways that this could be done - from (S)FTP, to SCP and rsync, to running commands like “git pull” and “composer install” directly on the server (not recommended). diff --git a/source/_talks/deploying-php-ansible-ansistrano.md b/source/_talks/deploying-php-ansible-ansistrano.md index c53652549..f87fb104d 100644 --- a/source/_talks/deploying-php-ansible-ansistrano.md +++ b/source/_talks/deploying-php-ansible-ansistrano.md @@ -8,7 +8,7 @@ tags: [meetup, php, ansible, ansistrano] events: - event: drupal_bristol - date: '2019-01-23' + date: 2019-01-23 --- Great! You’ve built your website, and now you just need to deploy it. There are various ways that this could be done - from (S)FTP, to SCP and rsync, to running commands like `git pull` and `composer install` directly on the server which is not ideal. diff --git a/source/_talks/deploying-php-fabric.md b/source/_talks/deploying-php-fabric.md index 9b5112eec..9839ff0b4 100644 --- a/source/_talks/deploying-php-fabric.md +++ b/source/_talks/deploying-php-fabric.md @@ -17,14 +17,14 @@ meta: type: image/png events: - event: nomad_php - date: '2017-04-20' + date: 2017-04-20 time: '19:00 (CET)' type: 'Lightning talk' - event: phpsw - date: '2017-09-13' + date: 2017-09-13 joindin: https://joind.in/talk/a5ff3 - event: phpnw_17 - date: '2017-10-01' + date: 2017-10-01 time: '09:00 - 09:45' joindin: https://joind.in/talk/4e35d --- diff --git a/source/_talks/drupal-8-module-development.md b/source/_talks/drupal-8-module-development.md index 8e829f8a2..fbb2e730b 100644 --- a/source/_talks/drupal-8-module-development.md +++ b/source/_talks/drupal-8-module-development.md @@ -19,7 +19,7 @@ meta: width: 960 events: - event: drupalcamp_london_16 - date: '2016-03-05' + date: 2016-03-05 --- New to object-orientated PHP, Symfony or YAML, and want to get started building modules in Drupal 8? This is the session for you! diff --git a/source/_talks/drupal-8-php-libraries-drupalorg-api.md b/source/_talks/drupal-8-php-libraries-drupalorg-api.md index d7d643618..1fa156b09 100644 --- a/source/_talks/drupal-8-php-libraries-drupalorg-api.md +++ b/source/_talks/drupal-8-php-libraries-drupalorg-api.md @@ -12,10 +12,10 @@ youtube: id: JyDjC7gGDpU events: - event: drupal_bristol - date: '2018-04-18' + date: 2018-04-18 joindin: https://joind.in/talk/14851 - event: drupalcamp_london_19 - date: '2019-03-01' + date: 2019-03-01 fuzzy_date: true --- A demo of some of the open source projects that I’ve been working on lately that are based on information from the Drupal.org API, including a PHP library for the API itself as well as some Drupal 8 modules that use it. diff --git a/source/_talks/drupal-8-rejoining-the-herd.md b/source/_talks/drupal-8-rejoining-the-herd.md index 3b1ffafc1..73993a1dd 100644 --- a/source/_talks/drupal-8-rejoining-the-herd.md +++ b/source/_talks/drupal-8-rejoining-the-herd.md @@ -7,7 +7,7 @@ speakerdeck: url: https://speakerdeck.com/opdavies/drupal-rejoining-the-herd events: - event: php_south_coast_16 - date: '2016-06-11' + date: 2016-06-11 joindin: https://joind.in/talk/41d0f --- [Drupal 8][0] was (finally) released on November 19th 2015, after almost 4 years of work and code commits by over 3,200 different contributors. Whilst it’s pretty much the same as the Drupal that we know and, hopefully, love, a lot has changed behind the scenes and under the hood! diff --git a/source/_talks/drupal-8.md b/source/_talks/drupal-8.md index 21ed6e9be..1a587a610 100644 --- a/source/_talks/drupal-8.md +++ b/source/_talks/drupal-8.md @@ -10,7 +10,7 @@ tags: [meetup, phpsw, drupal, drupal-8] tweets: yes events: - event: phpsw - date: '2015-04-08' + date: 2015-04-08 --- This was a ten minute lightning talk, designed to highlight the major changes coming in Drupal 8. diff --git a/source/_talks/drupal-vm-generator.md b/source/_talks/drupal-vm-generator.md index a58dc971d..493bbf85d 100644 --- a/source/_talks/drupal-vm-generator.md +++ b/source/_talks/drupal-vm-generator.md @@ -11,9 +11,9 @@ youtube: id: U1pbKAAO2Wo events: - event: nwdug - date: '2016-03-08' + date: 2016-03-08 - event: drupal_bristol - date: '2016-04-02' + date: 2016-04-02 --- An short talk about the [Drupal VM Generator][1] project. diff --git a/source/_talks/drupal-vm-meet-symfony-console.md b/source/_talks/drupal-vm-meet-symfony-console.md index d2e8862f4..c08673870 100644 --- a/source/_talks/drupal-vm-meet-symfony-console.md +++ b/source/_talks/drupal-vm-meet-symfony-console.md @@ -8,7 +8,7 @@ speakerdeck: image: drupal-vm-meet-symfony-console.png events: - event: drupalcamp_bristol_16 - date: '2016-07-23' + date: 2016-07-23 --- _TL;DR - Come and learn about Symfony Console, with examples from a real-world project._ diff --git a/source/_talks/drupalorg-2015.md b/source/_talks/drupalorg-2015.md index abafdfbc3..0e34007ec 100644 --- a/source/_talks/drupalorg-2015.md +++ b/source/_talks/drupalorg-2015.md @@ -7,8 +7,8 @@ speakerdeck: url: https://speakerdeck.com/opdavies/drupal-dot-org-in-15 events: - event: drupalcamp_brighton_15 - date: '2015-01-18' + date: 2015-01-18 - event: drupalcamp_london_15 - date: '2015-02-28' + date: 2015-02-28 --- A retrospective of the Drupal Association’s work in 2014 and a look forward to what we’ll be working on in 2015. diff --git a/source/_talks/drush-make-drupalbristol.md b/source/_talks/drush-make-drupalbristol.md index 2c61f3e51..63e6a8b36 100644 --- a/source/_talks/drush-make-drupalbristol.md +++ b/source/_talks/drush-make-drupalbristol.md @@ -7,6 +7,6 @@ speakerdeck: tags: [meetup, drupal, drupal_bristol, drush, drush-make] events: - event: drupal_bristol - date: '2014-08-19' + date: 2014-08-19 --- An introduction to Drush Make and how to use it to build reusable custom installation profiles or entire websites. diff --git a/source/_talks/getting-your-data-into-drupal-8.md b/source/_talks/getting-your-data-into-drupal-8.md index ead9df485..dd89dd13f 100644 --- a/source/_talks/getting-your-data-into-drupal-8.md +++ b/source/_talks/getting-your-data-into-drupal-8.md @@ -20,9 +20,9 @@ meta: use: [talks] events: - event: drupal_bristol - date: '2017-01-18' + date: 2017-01-18 - event: drupalcamp_london_17 - date: '2017-03-04' + date: 2017-03-04 time: '12:05 - 12:50' --- If you’ve moved a site from Drupal 6 to 7, the chances are that you’ve either used the upgrade path to update your old site in-place, or you built a new site from scratch and used the Migrate module from contrib to migrate your data from the old database. diff --git a/source/_talks/git-flow.md b/source/_talks/git-flow.md index a842354a1..775480a08 100644 --- a/source/_talks/git-flow.md +++ b/source/_talks/git-flow.md @@ -10,6 +10,6 @@ tags: [conference, drupalcamp, drupalcamp-london, git, git-flow] tweets: yes events: - event: drupalcamp_london_14 - date: '2014-03-01' + date: 2014-03-01 --- An introduction to the Git Flow branching model and the git-flow plugin, and how I’ve used them to manage a Drupal development project. diff --git a/source/_talks/goodbye-drush-make-hello-composer.md b/source/_talks/goodbye-drush-make-hello-composer.md index 2a7b25049..a8f08beff 100644 --- a/source/_talks/goodbye-drush-make-hello-composer.md +++ b/source/_talks/goodbye-drush-make-hello-composer.md @@ -9,9 +9,9 @@ youtube: id: ZL2FtRTX9Y8 events: - event: drupal_bristol - date: '2016-11-17' + date: 2016-11-17 - event: php_uk_18 - date: '2018-02-16' + date: 2018-02-16 time: '14:40 - 15:40' joindin: https://joind.in/talk/650ab --- diff --git a/source/_talks/it-all-started-with-a-patch.md b/source/_talks/it-all-started-with-a-patch.md index 51e2a2803..6f095a84b 100644 --- a/source/_talks/it-all-started-with-a-patch.md +++ b/source/_talks/it-all-started-with-a-patch.md @@ -10,6 +10,6 @@ youtube: id: 5FYMRR61sdo events: - event: phpsw - date: '2017-02-08' + date: 2017-02-08 --- A crash course of why and how to get involved with open source. diff --git a/source/_talks/modern-drupal-development-with-composer.md b/source/_talks/modern-drupal-development-with-composer.md index 6e12baefa..2550dccd9 100644 --- a/source/_talks/modern-drupal-development-with-composer.md +++ b/source/_talks/modern-drupal-development-with-composer.md @@ -10,7 +10,7 @@ youtube: id: Yi_FPI3xHwc events: - event: phpsw - date: '2016-11-09' + date: 2016-11-09 --- Building a Drupal application? You no longer need to download archives to add new modules or update core, or deal with Drupal specific tools to manage your codebase. diff --git a/source/_talks/so-what-is-this-drupal-thing.md b/source/_talks/so-what-is-this-drupal-thing.md index 5509eb368..27089d3e3 100644 --- a/source/_talks/so-what-is-this-drupal-thing.md +++ b/source/_talks/so-what-is-this-drupal-thing.md @@ -5,6 +5,6 @@ vimeo: tags: [meetup, drupal, unified-diff] events: - event: unified_diff - date: '2012-09-05' + date: 2012-09-05 --- My very first talk, where I talk about Drupal, what it is and what it can do. diff --git a/source/_talks/taking-flight-with-tailwind-css.md b/source/_talks/taking-flight-with-tailwind-css.md index 82b95bc93..1419e51e4 100644 --- a/source/_talks/taking-flight-with-tailwind-css.md +++ b/source/_talks/taking-flight-with-tailwind-css.md @@ -8,9 +8,9 @@ speakerdeck: tags: [css, tailwind, meetup] events: - event: drupal_bristol - date: '2018-01-17' + date: 2018-01-17 - event: php_south_wales - date: '2018-07-31' + date: 2018-07-31 meta: og: title: Taking Flight with Tailwind CSS diff --git a/source/_talks/tdd-test-driven-drupal.md b/source/_talks/tdd-test-driven-drupal.md index 219e95ff7..84b7f4827 100644 --- a/source/_talks/tdd-test-driven-drupal.md +++ b/source/_talks/tdd-test-driven-drupal.md @@ -21,20 +21,20 @@ meta: use: [talks] events: - event: drupalcamp_london_17 - date: '2017-03-04' + date: 2017-03-04 time: '16:15 - 17:00' - event: drupalcamp_dublin_17 - date: '2017-10-21' + date: 2017-10-21 time: '12:00 - 12:40' - event: drupal_bristol - date: '2017-11-22' + date: 2017-11-22 - event: drupal_somerset - date: '2018-06-14' + date: 2018-06-14 - event: drupal_dev_days_18 - date: '2018-07-05' + date: 2018-07-05 time: '12:15 - 13:00' - event: drupalcamp_london_19 - date: '2019-03-01' + date: 2019-03-01 fuzzy_date: true --- {% block content %} diff --git a/source/_talks/test-drive-twig-with-sculpin.md b/source/_talks/test-drive-twig-with-sculpin.md index d67e85075..6758c8855 100644 --- a/source/_talks/test-drive-twig-with-sculpin.md +++ b/source/_talks/test-drive-twig-with-sculpin.md @@ -9,7 +9,7 @@ tags: [conference, drupalcamp, drupalcamp-north, sculpin, twig] tweets: yes events: - event: drupalcamp_north_15 - date: '2015-07-25' + date: 2015-07-25 --- [Sculpin][1] is a static site generator written in PHP, and based on [Symfony components][2]. It uses [YAML][3] and [Twig][4], which makes it very appealing to Drupal people wanting to learn these in preparation for Drupal 8. diff --git a/source/_talks/2019-01-28-things-you-should-know-about-php.md b/source/_talks/things-you-should-know-about-php.md similarity index 93% rename from source/_talks/2019-01-28-things-you-should-know-about-php.md rename to source/_talks/things-you-should-know-about-php.md index de13d243f..e73173421 100644 --- a/source/_talks/2019-01-28-things-you-should-know-about-php.md +++ b/source/_talks/things-you-should-know-about-php.md @@ -12,6 +12,6 @@ meta: url: /images/talks/things-you-should-know-about-php.png events: - event: ssdc - date: '2019-01-28' + date: 2019-01-28 --- An introduction to PHP, presented to the Swansea Software Development Community (SSDC). diff --git a/source/_talks/using-laravel-collections-outside-laravel.md b/source/_talks/using-laravel-collections-outside-laravel.md index 4586c8344..516137f58 100644 --- a/source/_talks/using-laravel-collections-outside-laravel.md +++ b/source/_talks/using-laravel-collections-outside-laravel.md @@ -10,9 +10,9 @@ tags: [nomad-php, lightning-talk, laravel, collections] type: Lightning talk events: - event: nomad_php - date: '2017-12-21' + date: 2017-12-21 time: 19:00 CET - event: php_south_wales - date: '2018-08-28' + date: 2018-08-28 --- Laravel Collections are a powerful object-orientated way of interacting with PHP arrays, but did you know that they can be used outside of Laravel, in any PHP project? This short talk shows how we can use Composer to include Laravel Collections within a non-Laravel project and put them to use within your own code. diff --git a/source/talks.html.twig b/source/talks.html.twig index 882081d45..e6d4ed8e7 100644 --- a/source/talks.html.twig +++ b/source/talks.html.twig @@ -8,24 +8,24 @@ talks: - title: 'Drupal and the LDAP module' events: - event: swdug - date: '2013-07-10' + date: 2013-07-10 - title: 'About the Drupal Association' events: - event: swdug - date: '2014-08-19' + date: 2014-08-19 - title: 'Automated testing with Drupal 8 and PHPUnit' type: Workshop events: - event: drupal_bristol - date: '2018-06-27' + date: 2018-06-27 - title: 'Episode #175 - Automated Testing' type: Podcast url: http://talkingdrupal.com/175 events: - event: talking_drupal - date: '2018-09-05' + date: 2018-09-05 --- {% block content %}
diff --git a/src/TalksBundle/TwigExtension/TalksExtension.php b/src/TalksBundle/TwigExtension/TalksExtension.php index b50f0e3e3..1d1e290f4 100644 --- a/src/TalksBundle/TwigExtension/TalksExtension.php +++ b/src/TalksBundle/TwigExtension/TalksExtension.php @@ -19,7 +19,7 @@ class TalksExtension extends Twig_Extension $this->today = (new \DateTime()) ->modify('today') ->setTimezone(new \DateTimeZone('Europe/London')) - ->format('Y-m-d'); + ->getTimestamp(); } /** diff --git a/tests/TalksBundle/TwigExtension/FormatTalksTest.php b/tests/TalksBundle/TwigExtension/FormatTalksTest.php index bab180040..f4c1baaed 100644 --- a/tests/TalksBundle/TwigExtension/FormatTalksTest.php +++ b/tests/TalksBundle/TwigExtension/FormatTalksTest.php @@ -42,14 +42,14 @@ class FormatTalksTest extends TestCase [ 'title' => 'Talk A', 'events' => [ - ['event' => 'event-a', 'date' => '2018-01-01', 'time' => '09:00'], - ['event' => 'event-b', 'date' => '2018-01-30', 'time' => '12:00'], + ['event' => 'event-a', 'date' => strtotime('2018-01-01'), 'time' => '09:00'], + ['event' => 'event-b', 'date' => strtotime('2018-01-30'), 'time' => '12:00'], ], ], [ 'title' => 'Talk B', 'events' => [ - ['event' => 'event-b', 'date' => '2018-01-31', 'time' => '17:00'], + ['event' => 'event-b', 'date' => strtotime('2018-01-31'), 'time' => '17:00'], ], ], ]; @@ -63,7 +63,7 @@ class FormatTalksTest extends TestCase $this->assertArrayHasKey('talk', $result); $this->assertEquals([ - 'date' => '2018-01-01', + 'date' => '1514764800', 'event' => 'event-a', 'location' => 'Somewhere', 'name' => 'Event A', @@ -79,7 +79,7 @@ class FormatTalksTest extends TestCase $this->assertArrayHasKey('talk', $result); $this->assertEquals([ - 'date' => '2018-01-30', + 'date' => 1517270400, 'event' => 'event-b', 'location' => 'Somewhere else', 'name' => 'Event B', @@ -98,9 +98,9 @@ class FormatTalksTest extends TestCase /** @test */ public function get_all_events() { - $eventA = ['date' => (new DateTime('+1 week'))->format('Y-m-d')]; - $eventB = ['date' => (new DateTime('-2 weeks'))->format('Y-m-d')]; - $eventC = ['date' => (new DateTime('today'))->format('Y-m-d')]; + $eventA = ['date' => (new DateTime('+1 week'))->getTimestamp()]; + $eventB = ['date' => (new DateTime('-2 weeks'))->getTimestamp()]; + $eventC = ['date' => (new DateTime('today'))->getTimestamp()]; $talks = [ ['events' => [$eventA, $eventB]], @@ -121,11 +121,11 @@ class FormatTalksTest extends TestCase /** @test */ public function get_upcoming_events() { - $eventA = ['date' => (new DateTime('+1 week'))->format('Y-m-d')]; - $eventB = ['date' => (new DateTime('-2 weeks'))->format('Y-m-d')]; - $eventC = ['date' => (new DateTime('today'))->format('Y-m-d')]; - $eventD = ['date' => (new DateTime('+1 day'))->format('Y-m-d')]; - $eventE = ['date' => (new DateTime('+2 weeks'))->format('Y-m-d')]; + $eventA = ['date' => (new DateTime('+1 week'))->getTimestamp()]; + $eventB = ['date' => (new DateTime('-2 weeks'))->getTimestamp()]; + $eventC = ['date' => (new DateTime('today'))->getTimestamp()]; + $eventD = ['date' => (new DateTime('+1 day'))->getTimestamp()]; + $eventE = ['date' => (new DateTime('+2 weeks'))->getTimestamp()]; $talks = [ ['events' => [$eventA, $eventC]], @@ -146,12 +146,12 @@ class FormatTalksTest extends TestCase /** @test */ public function get_past_events() { - $eventA = ['date' => (new DateTime('+1 week'))->format('Y-m-d')]; - $eventB = ['date' => (new DateTime('-2 weeks'))->format('Y-m-d')]; - $eventC = ['date' => (new DateTime('today'))->format('Y-m-d')]; - $eventD = ['date' => (new DateTime('+1 day'))->format('Y-m-d')]; - $eventE = ['date' => (new DateTime('-2 days'))->format('Y-m-d')]; - $eventF = ['date' => (new DateTime('-2 months'))->format('Y-m-d')]; + $eventA = ['date' => (new DateTime('+1 week'))->getTimestamp()]; + $eventB = ['date' => (new DateTime('-2 weeks'))->getTimestamp()]; + $eventC = ['date' => (new DateTime('today'))->getTimestamp()]; + $eventD = ['date' => (new DateTime('+1 day'))->getTimestamp()]; + $eventE = ['date' => (new DateTime('-2 days'))->getTimestamp()]; + $eventF = ['date' => (new DateTime('-2 months'))->getTimestamp()]; $talks = [ ['events' => [$eventD]],