Hi everyone! I am fairly new to the wix platform but I have already been exploring as much as I can.
On to my issue, I am wondering if it is possible to change the placeholder text of a date picker to the value selected? I am not seeing anything in the Wix code api section that mentions this. So I am curious if anyone has achieved this.
Look forward to hearing from you! Thanks!
Dana White
Hello
You can get and set the value of a date picker place holder value. see the code bellow:
$w.onReady(function () {
//TODO: write your page related code here...
let date = new Date(2011, 0, 1, 2, 3, 4, 567)
$w('#datePicker1').value = date // set value
console.log($w('#datePicker1').value) //get value
});
The value should change automatically when a new date is picked. if this code doesn’t cover your issue please provide your editor or website URL.
Best
Massa
Thank you very much! It worked like a charm!
Hi Massa,
How can i set the placeholder text for datpicker to a string? Like reset it back to “From” and “To” . It is doable in wix datepicker setting but not with code. Datepicker is missing a placeholder property in code. Please let me know if any other solution is there for this issue…