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) {
socket.emit('sockettoDate', $('#x').val());
}
});
If '2017-11-16' selected, I want to emit '2017-11-17'. Is there any way to do that?
Following code should work for you:
$('#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);
}
});