I want to emit the day after the selected day.
$('#toDate').datepicker({
inline: true,
altField: '#x',
dateFormat: "dd-mm-yy", //day
altFormat: "yy-mm-dd", //year
monthNames: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"],
dayNamesMin: ["Pa", "Pt", "Sl", "Ça", "Pe", "Cu", "Ct"],
firstDay: 1,
numberOfMonths: 1,
onSelect: function(dateText, inst) {
var dateup = ('0' + (parseInt(inst.selectedDay) + 1)).slice(-2);
var monthup = ('0' + (parseInt(inst.selectedMonth) + 1)).slice(-2);
var newdate = inst.selectedYear+'-'+monthup+'-'+dateup;
socket.emit('sockettoDate', newdate);
}
});
This code cannot calculate the day after the last day of month.
For example if 2017-12-31 selected, result is 2017-12-32. Any solution?