+ Start a Discussion
Adelchi PelizzoAdelchi Pelizzo 

Lightning Trailhead Error

There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: OVSPKDKP

https://developer.salesforce.com/trailhead/lightning_components/lightning_components_expressions
Jeff DouglasJeff Douglas
Thanks Adelchi! I'll pass it along and report back.
Jeff Douglas 20Jeff Douglas 20
I spun up a new DE org and completed the challenge successfully. Are you using a brand new DE org?

Go ahead and send me your code (jdouglas@salesforce.com) and I'll take a look at it.
Adelchi PelizzoAdelchi Pelizzo
I tried both new and old dev org. Didn't work. Now it is working OK because I simplified the code.
FYI This was the code that generated error.
Controller
({
      doInit: function(cmp) {
        var Today = new Date();               
          if  (Today.getDay()==0) {cmp.set("v.IsSaturday", true); }    
          if  (Today.getDay()==1) {cmp.set("v.IsSunday", true);} 
          if  (Today.getDay()==2) {cmp.set("v.IsMonday", true); } 
          if  (Today.getDay()==3) {cmp.set("v.IsTuesday", true); } 
          if  (Today.getDay()==4) {cmp.set("v.IsWednesday", true); } 
          if  (Today.getDay()==5) {cmp.set("v.IsThursday", true); } 
          if  (Today.getDay()==6) {cmp.set("v.IsFriday", true); }

      }
})

Component
<aura:component >
<aura:attribute name = "IsSunday" type = "Boolean" default="false"/>
    <aura:attribute name = "IsMonday" type = "Boolean" default="false"/>
    <aura:attribute name = "IsTuesday" type = "Boolean" default="false"/>
    <aura:attribute name = "IsWednesday" type = "Boolean" default="false"/>
    <aura:attribute name = "IsThursday" type = "boolean" default="false"/>
    <aura:attribute name = "IsFriday" type = "boolean" default="false"/>
    <aura:attribute name = "IsSaturday" type = "boolean" default="false"/>
<aura:attribute name="today" type="Date" default=""/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    <aura:if isTrue="{!v.IsSunday}" >
       <p> Today is Sunday </p>
    </aura:if>
    <aura:if isTrue="{!v.IsMonday}" >
       <p> Today is Monday </p>
    </aura:if>
    <aura:if isTrue="{!v.IsThursday}" >
       <p> Today is Tuesday </p>
    </aura:if>
    <aura:if isTrue="{!v.IsWednesday}" >
       <p> Today is Wednesday </p>
    </aura:if>
    <aura:if isTrue="{!v.IsThursday}" >
       <p> Today is IsThursday </p>
    </aura:if>
    <aura:if isTrue="{!v.IsFriday}" >
       <p> Today is Friday </p>
    </aura:if>
    <aura:if isTrue="{!v.IsSaturday}" >
       <p> Today is Saturday </p>
    </aura:if>
    
</aura:component>

Thanks.
Adelchi
Jeff DouglasJeff Douglas
Adelchi,

You only need the code in the component with a single  DayOfTheWeek attribute. Then use a series of aura:if expressions to test if the attribute is the same as the day and then output the message.

Good luck!
Jeff Douglas
Trailhead Developer Advocate