function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jonathan Bernd 31Jonathan Bernd 31 

aura dynamic date display problem

Hi
This is for a trailhead challenge.
The goal is to find today's day (name) and then update a string to say Today is "day".
We have to use aura:if

I can get it to work if I put in a default day, but I want my component to know the actual day. I don't know if there is anything I can do to pull in today() to my attribute.

I've got a javascript function (here) but cannot tether it properly to my component without having an event to activate the function (like button click or input field).  This is probably because I don't really know javascript or aura.  (Hence trailhead).

Help would be greatly appreciated.
Here's my javascript to get the day in case it's needed.
({

myDay :  function (component, event, helper)  {

var d = new Date();
var wday = new Array(7);
wday[0]=  "Sunday";
wday[1] = "Monday";
wday[2] = "Tuesday";
wday[3] = "Wednesday";
wday[4] = "Thursday";
wday[5] = "Friday";
wday[6] = "Saturday";

var n = wday[d.getDay()];

}

})