From d1bce79978b71d1b6a7755b54a052f8148be79b0 Mon Sep 17 00:00:00 2001 From: Mariano Perdomo Date: Sun, 6 Jan 2019 23:26:59 -0300 Subject: [PATCH] Add function to show current year --- js/slides/0_Slides_Intro.js | 7 +++++++ words.html | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/js/slides/0_Slides_Intro.js b/js/slides/0_Slides_Intro.js index e082f106..163f780f 100644 --- a/js/slides/0_Slides_Intro.js +++ b/js/slides/0_Slides_Intro.js @@ -116,6 +116,13 @@ SLIDES.push({ text_id:"intro" }); + var _showYear = function(){ + var currentYear = Words.get("intro"); + currentYear = currentYear.replace(/\[X\]/g, new Date().getFullYear()); + self.objects.intro_text.setText(currentYear); + }; + _showYear(); + // Button self.add({ id:"intro_button", type:"Button", x:304, y:466, size:"long", diff --git a/words.html b/words.html index 99bd8135..094b6bd6 100644 --- a/words.html +++ b/words.html @@ -103,7 +103,7 @@ and gathered to bury their dead, exchange gifts, and play games.

-Meanwhile: it's 2017, the West has been at peace for decades, and
+Meanwhile: it's [X], the West has been at peace for decades, and
wow, we suck at trust. Surveys show that, over the past forty years, fewer and fewer people say they trust each other. So here's our puzzle: