nanami
1
Thank you for reading.
There are 2dates in the database.
1date is the display start date named ‘dayfrom’
2nd date is the display end date named ‘dayto’
The database name ‘news’
this is my code;
import wixData from 'wix-data';
$w.onReady(function () {
QuoteArray();
});
export function QuoteArray(){
const today = new Date();
// ...
wixData.query("news")
.between("today", 'dayfrom', 'dayto')
.find()
.then( (results) => {
} )
.catch( (error) => {
let errorMsg = error.message;
let code = error.code;
} );}
Please tell me where is wrong.
You can change filteration method arguments to =====> wixData . query ( “news” ). between ( ‘dayfrom’ , ‘dayto’ ). find (). then (( results ) => {})
nanami
3
Hi Poornima Kalinge,
Thank you for your answer.
I try but not work ; ;
nanami
4
Could you help me anyone?
muthu
5
In Database ,
Does Both dayfrom and dayto are the Date Field ?
muthu
7
import wixData from ‘wix-data’ ;
$w.onReady( function () {
QuoteArray();
});
export function QuoteArray(){
const today = new Date();
wixData.query( ‘news’ )
.gt( ‘dayfrom’ , today)
.lt( ‘dayto’ , today)
.find().then(results => {
console.log(results)
} )
. catch ( (error) => {
let errorMsg = error.message;
let code = error.code;
} )
;}
// This may be your final Code
nanami
8
Hi Er.Muthu K ,
Thank you for your reply.
That’s right this is Both dayfrom and dayto are the Date Field.
And I try your code, but its not work.
test1 must be hide, because Feb 01~ Feb 10
But its display yet…
muthu
9
What is your getting in your Console ?
muthu
12
What is the Output of Line#14 ?
muthu
14
import wixData from ‘wix-data’ ;
$w.onReady( async function () {
const today = new Date();
let query = await wixData.query( ‘news’ )
.lt( ‘dayfrom’ , today)
.gt( ‘dayto’ , today)
.find().then(results => {
console.log(results);
console.log( "QUERY = " +query);
} )
. catch ( (error) => {
let errorMsg = error.message;
let code = error.code;
} )
;
});
muthu
15
Test 1 Not Came With the Below Video;
Now It Will Work
muthu
16
Please Update with this Code.
I made minor Changes .
If you see the Video , You will not Get test1 As Expected.

nanami
17
Thank you for your kindness.
But not work on website.
Surely the total count is 2 on console log, but test 1 is display…; ;
Sorry several times ask…
muthu
18
Have you sync Sandbox to Live ?
muthu
20
The Above text is URL ,
Please copy and Paste it with Browser’s URL Bar