How to query a date field and show with a lamp if it isn´t empty?

  1. Instead of using —> nicknames —> maybe you can use the → OWNER-ID → " _owner "
  2. All you need are two dates, right? → STARTING-DATE and EXPIRE-DATE to be able to calculate between these 2 dates. You also can break down date and time to a unique unit called → TIMESTAMP <— and with these timestamps you can calculate very easy.

You can use some online time-converter, like…
Epoch Converter - Unix Timestamp Converter

  1. You can install → MOMENT.JS in your project, to work more easy with dates and times…

You also can open the DOCUMENTATION of MOMENT.JS and try to understand how this JS-LIBRARY works.

You can open YOUTUBE and learn even more about all these stuff…
(23) Display/Format Dates & Times - Moment.js Tutorial #5 - YouTube

You can make your first steps with MOMENT.JS starting with this example here…

I just played around a little bit and already after 5-10min of brainstorming got this results using MOMENT.JS…
I do not really know a lot about MOMENT, but seems to be easy to use, if it comes to DATES and TIMES.

import moment from 'moment';

$w.onReady(()=> {let mom = moment(); console.log(mom);
    console.log("-----------------------");
    console.log("YEAR: ", mom.year());
    console.log("MONTH: ", mom.month());
    console.log("WEEK: ", mom.week());
    console.log("DAY: ", mom.day() + " / ---> " + "0=Sun,1=Mon,...,6=Sat");
    console.log("HOUR: ", mom.hours());
    console.log("MIN: ", mom.minutes());
    console.log("SEC: ", mom.seconds());let tStamp = mom.unix();
    console.log("T-STAMP :", tStamp);

    console.log("-----------------------");
    console.log('Which QUARTER of this year do we have?');
    console.log("QUARTER: ", mom.quarter());    
    console.log("-----------------------");});

Follow the good explained VIDEOS provided in the link above and start your coding adventure.

  1. Maybe you will also find some other posts about of how to work with dates and times…

[SOLVED] Find the difference (in hours), between 2 dates | Velo by WixHi All, I have previously used WIX to build great websites but am progressing to the point that I need to begin using WIX code. My first project is to build a form and backend database to capture user input. Is there a way that employees can fill in start and end dates in the form and then the l
There are a lot of examples out there.

On the other hand it should be pretty easy I think to make the lamps shift with each others if the system could regognize that the date field is filled or empty.

To determine if a BD-FIELD is not empty → .isNotEmpty(‘DB_FIELD_IDhere’)
To determine if a DB-FIELD is empty -------> .isEmpty(‘DB_FIELD_IDhere’)

Surely you have also generated a CODE for your REPEATER, after you have gotten the results of your query!?! Something like…

//---REPLACE THIS PART WITH YOUR REAL QUERY-CODE.....let res = your RESULTSlet items = res.items; console.log(items);$w('#yourRepeaterIDhere').data = items;//---REPLACE THIS PART WITH YOUR REAL QUERY-CODE.....

$w.onReady(()=>{console.log("Page is ready...)$w('#yourRepeaterIDhere').onItemReady(($i,iData,inx)=>{
		console.log('index: ', inx);
		console.log('item: ', iData);//LAMP-CHECK................//Generating some variables holding the needed date&time.	let tStamp1 = iData._createdDate -> convert 2 timestamp
		let tStamp2 = iData.expiryDate -> convert 2 timestamp
		let tStamp3 = new Date();//NOW YOU SHOULD HAVE TWO or more different TIMESTAMPS// WHAT TO DO NEXT WITH THIS TIMESTAMPS???
		a) CALCULATE ? --> tStamp1-tStamp2?
		b) COMPARE? if(tStamp1===tStamp2) {...} else {...} ???//GENERATE YOUR IF_ELSE_CONDITIONif(iData.) {}else {}CONSOLE-LOG YOUR RESULT AND CHECK IT.
		console.log(..........)});});

This is just a PROTOTYPE-EXAMPLE-SNIPET.

Put all things together, take your time, understand first what you are trying to do.
Take some days to practise to work with dates and times and their calculations.

At the end you will solve your problem, i am sure.