I have a dynamic page. On the page I have text linked to a database, the text displays a date.
When the page first loads the date shows in the correct format, however after about 3 seconds the date format changes.
This is the code im using:
import wixUsers from ‘wix-users’;
$w.onReady( function () {
$w("#dateDataset").onReady(() => {
// Get the date from the date field of the current item
const date = $w(“#dateDataset”).getCurrentItem()._createdDate;
// Define the date preferences
const options = {
weekday: “short”,
year: “numeric”,
month: “long”,
day: “numeric”
};
// Display the date in the text element using the defined preferences
$w(“#dateText”).text = date.toLocaleDateString(“en-US”, options);
});
})
Anyone know why the date is format is changing automatically ?