ShowWhen = Specific Time


#1

Hello guys,

i am trying to see if there is any way to like have specific contents to show to the user on a specific day. So like, for monday it would show content for monday, for tuesday content for tuesday, and so on. but i want to make it so that it automatically does this, all i have to do is set it up and the program automatically runs it by detecting the users location/date and shows them that specific content for that day. Is there a way to do that? after research ive found the showWhen element but i am wondering if i can use that with time or is there a different way.

Thanks
em11rock


#2

You can show the content whatever you want based on conditions…

First of all you need to get the date and time.Using this you will get to know what the day is and time is…After that

just make some variables true based on the information what you get.

if(day=="Monday"){
    this.monday=true;
}
else if(day=="Tuesday"){
    this.tuesday=true;
}
<div *ngIf="monday">

</div>

<div *ngIf="Tuesday">

</div>