Date field

I am trying to create a table of dynamic page, On the website i only want to show the Date without time, but the database doesnt hv the option to delete the time, so it just keep showing the date and time on the content

Hi,
Some code is needed to reformat the date
Check out this thread .
Good luck!
Roi

Hi i look through the forum, but i cannot fix still. The same coding to place on my site, the date field doesnt hv any changes

My coding is below. Not sure what is wrong. The Original date ona a varaible is call “expirationDate”


$w.onReady(function () {
//TODO: write your page related code here…

const expirationDate = $w(‘#text41’).text;
const newDate = expirationDate.split(’ ‘).splice(0, 4).join(’ ‘);
$w(’#text41’).text = newDate;
});

Hi,
You need to wrap those 3 lines in $w(‘#yourDataset’).onReady
For more information read this .
Good luck
Roi

i have no idea what’s happening.
Sound like i need to need to add $w(“#listings”).onReady , since my dataset is called “listings”
But it doesn’t work still.

// For full API documentation, including code examples, visit http://wix.to/94BuAAs

$w.onReady(function () {
	//TODO: write your page related code here...

  $w("#listings").onReady( () => {

const expirationDate = $w('#text42').text;
const newDate = expirationDate.split(' ').splice(0, 4).join(' ');
$w('#text42').text = newDate;
});
} );

Also attached with my image below:

Hi,
Is “listing” is the name of the database collection or the dataset’s element id ?
Roi

yes, did u see on the photo the name if the dataset is called listing

Can you please share the link to your site ?
Roi

Thx Roi. Hope u can look up for me.

My website is : https://belvinip.wixsite.com/sharelistings/listings

Hi,
“listing” is the name of the database collection. “dynamicDataset” is the name of the Dataset element.
Go to “View properties” menu of the element and you will see it on the first field.
Roi

Hi where is the “view properties” menu of the element. i canont find it. element

I have changed the database name to “dynamicDataset” from the coding. Still doesn’t show anything. WEIRD

Hi 2spacemelbourne,

Click on text field that your time will be connecting to or showing on your live site (not in database).
Click ‘connect to data’ icon.
Scroll down to “choose format”.
Choose “short date”.

Hope this helps, not sure if you already have your situation resolved.