Photo change on daily basis

Hello,

is there any possibility to change photo (or slider background) on daily basis?

To clarify what I need is that I have (yoga) classes, each day different. And I want to show on some position what are classes for that day. So I need reccuring change of pictures (or whatever editable) on 7 day pariod. I guess there will be a solution via wox code?

I know about “calendar” app but its features cannot be modified.

Thanks a lot.

Hi,
I have created a quick demo for your case. Enjoy😊
Demo link (Close on 27th June 2018)
https://howplayhk.wixsite.com/weekdaydemo

Prepare

  • A Database with two field (day & image)

  • For day < you need to set it as text

Coding

import wixData from 'wix-data';

$w.onReady(function () {
 var d = new Date();
 var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
 let weekday = days[d.getDay()];
    //"Days" < it equal to name of database...
    wixData.query("Days").eq("day", weekday).find().then((res)=>{
        $w("#columnStrip1").expand();
        $w("#columnStrip1").background.src = res.items[0].image;
    }).then(()=>{
        $w("#text1").text = weekday;
    });
});

Special remark:
Elements above do not need to connect any dataset.

Get your image today

Have a nice day : )
Heson

5 Likes

It works perfectly, thank you

I try to get the day of the week, to filter tasks by day of the week and without success. Attached is a screenshot of an attempt to get the day before and without success! Need desperate help!
Thanks 1