Good morning. I have a Datetime picker in a form to select a date and I need 30 days to add it and the result appears in a input with 'YYYY-MM-DD' format. I capture the value in the event 'onChange' of Datetime picker . The problem comes when adding the indicated amount and obtaining the date in the required format.
$('.datepicker-only-init').datetimepicker({
format: 'YYYY-MM-DD'
}).on('dp.change', function (e) {
console.log(e.date);
});
A cosole.log of the date returns this format:
Wed May 31 2017 10:12:02 GMT-0400 (Western Standard Time, South America)