@jfriede
As promised —> here it is! —> https://www.media-junkie.com/datepicker
This is your interactive-example-slot.
Your database…
How to use this "interactive-example?
- You can use the predefined DATABASE → “SportSheduler”
- You can see, which fields are already activated and ready to use.
- Setup one of the 4 given DB-Presets/Slots to get your DATABASE connected.
Example…
You will have to change the PRESET/SLOT for —> “SportSheduler”
4) General-Settings:
DB -------------------------> “SportSheduler”
activated table --------> “table1”
activated repeater —> “repeater1” or “repeater2”
max. limit ----------------> 1000
5) DropDown-Fields:
Fill out the fields which are given in your interactive-example (day,year,date, and so on).
I am sure you will understand how to use this ![]()
And here your CODE, for your own purposes…
$w.onReady(function () {
$w('#dataset1').onReady(()=>{
var day, month, date, year, sports
$w('#btnSubmit').onClick(()=>{$w('#dataset1').save()})
$w('#dropdown1').onChange(()=>{sports = $w('#dropdown1').value})
$w('#timePicker1').onChange(()=>{console.log("GO2")
$w('#input4').enable()
$w('#input4').value = $w('#timePicker1').value.substring(0, 5)
})
$w('#datePicker1').onChange(()=>{console.log("GO1")
//Get day .....-----------------------------------------------------------------------------------------------------
if($w('#datePicker1').value.getDay()===1) {day = "Monday"; console.log(day); $w('#input1').value = day;}
if($w('#datePicker1').value.getDay()===2) {day = "Tuesday"; console.log(day); $w('#input1').value = day;}
if($w('#datePicker1').value.getDay()===3) {day = "Wensday"; console.log(day); $w('#input1').value = day;}
if($w('#datePicker1').value.getDay()===4) {day = "Thursday"; console.log(day); $w('#input1').value = day;}
if($w('#datePicker1').value.getDay()===5) {day = "Friday"; console.log(day); $w('#input1').value = day;}
if($w('#datePicker1').value.getDay()===6) {day = "Saturday"; console.log(day); $w('#input1').value = day;}
if($w('#datePicker1').value.getDay()===7) {day = "Sunday"; console.log(day); $w('#input1').value = day;}
date = $w('#datePicker1').value.getDate(); $w('#input2').value = date
year = $w('#datePicker1').value.getFullYear(); $w('#input5').value = year
$w('#input3').value = $w('#datePicker1').value.getDate().toLocaleString()
$w('#input6').value = $w('#datePicker1').value.toDateString()
//Get month ....----------------------------------------------------------------------------------------------------
if($w('#datePicker1').value.getMonth()===0) {month = "January"; console.log(month); $w('#input2').value = month;}
if($w('#datePicker1').value.getMonth()===1) {month = "February"; console.log(month); $w('#input2').value = month;}
if($w('#datePicker1').value.getMonth()===2) {month = "March"; console.log(month); $w('#input2').value = month;}
if($w('#datePicker1').value.getMonth()===3) {month = "April"; console.log(month); $w('#input2').value = month;}
if($w('#datePicker1').value.getMonth()===4) {month = "May"; console.log(month); $w('#input2').value = month;}
if($w('#datePicker1').value.getMonth()===5) {month = "Juni"; console.log(month); $w('#input2').value = month;}
if($w('#datePicker1').value.getMonth()===6) {month = "July"; console.log(month); $w('#input2').value = month;}
if($w('#datePicker1').value.getMonth()===7) {month = "August"; console.log(month); $w('#input2').value = month;}
if($w('#datePicker1').value.getMonth()===8) {month = "September"; console.log(month); $w('#input2').value = month;}
if($w('#datePicker1').value.getMonth()===9) {month = "October"; console.log(month); $w('#input2').value = month;}
if($w('#datePicker1').value.getMonth()===10) {month = "November"; console.log(month); $w('#input2').value = month;}
if($w('#datePicker1').value.getMonth()===11) {month = "December"; console.log(month); $w('#input2').value = month;}
$w('#input1').enable()
$w('#input2').enable()
$w('#input3').enable()
$w('#input5').enable()
$w('#input6').enable()
$w('#dataset1').onBeforeSave(()=>{
$w("#dataset1").setFieldValues({
"title": "",
"day": day,
"date": date,
"month": month,
"year": year,
"sports": sports
});
});
});
});
});


