Ok, you have a dynamic page where you gets always the current item, when page loads. Then you have a database with the column (reference) “AuctionEnd”.
I assume there you have your DATE , which tells when an Auction has to stop, right?
Just try to understand the flow of your little project.
What often can help in almost every situation ist to create some “CONSOLE-LOGS”. You know what it is? It helps me a lot when i am struggling with some issues.
How to use it?
Well, let’s take your code as example.
$w.onReady( () => {
$w("#dynamicDataset").onReady( () => {
let itemObj = $w("#dynamicDataset").getCurrentItem();
let val = itemObj.AuctionEnd;
} );
} );
let countDownDate = new Date("val").getTime();
You can add this code here into your own:
console.log() //<<--- with this you start a log, which will be shown in the console-window.
Press F-12 in your google-chrome-browser (in other Browser it could be also another Key-Press) . A window will ioen on the right side. Then you go to console.
Now you are ready for all logs. (You have of course the same possibility when you use the PREVIEW-MODE in your Wix-Editor, there you will also finde a console-log-window.
Ok, what we want to log in our console-window?
We want always to see our outputs for better understanding right?
When you see the results, you will understand better what you are programming.
Now let’s go, let’s do it.
$w.onReady( () => {
$w("#dynamicDataset").onReady( () => {
let itemObj = $w("#dynamicDataset").getCurrentItem();
let val = itemObj.AuctionEnd;
console.log(itemObj) //<---- this should now show you the current item
console.log(val) //<---- should show you in the console-log-window the value of "AuctionEnd" (entry in your database)
} );
} );
So you have seen the example with DATE & TIME right?
Conclusion…
- You are now able to read-out/get data from your database.
- What do you get, if you console-log this part of your code?
$w.onReady( () => {
let countDownDate = new Date("val").getTime();
console.log (countDownDate)
} );
???
By the way, could you please show a little (related) part of your database?