[V1]Get Value From Date Picker

my function :

    var start_date = window.f7.calendar({
					input: '#start_date',
					dateFormat: 'dd-mm-yyyy',
					disabled: {
					from: today,
					},
					value: [new Date()],
					onDayClick:function(){
					**console.log(start_date.value)**
					start_date.close();
					}
				});

The problem is , im always getting value -1 … example :

im click datepicker, and default value is today , which is 30 Jan , then i click on 27 Jan , at console.log say (30 Jan) , and i open again calendar pick 26 Jan , then console.log say (27 Jan)

here the simple :
Open calendar = Date at 30 Jan
Click 27 Jan = at console.log say (30 Jan)
click 26 Jan = at console.log say (27 Jan)
click 25 Jan = at console.log say (26 Jan)

bug or i miss something ?

@nolimits4web

var calendar=app.calendar({
  closeOnSelect:true,
  onDayClick:function(c,dayContainer,year,month,day){
    // gets fired before "change"
    // but will return the selected date as args[year,month,day]
    // c.value/calendar.value != [year-month-day]
  },
  onChange:function(c,values,displayValues){
    // c.value/calendar.value == values
  }
});
1 Like

yes, thats works … thanks!