Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

add 1 year to current date javascript

// [SOLVED]  var date  = new Date(year + 1, month, day);

$('#membership_start').on('dp.change', function(e){
   console.log(e.date);

   var year  = new Date(e.date).getFullYear();
   var month = new Date(e.date).getMonth();
   var day   = new Date(e.date).getDate();
   var date  = new Date(year + 1, month, day);
   $('#membership_end').data("DateTimePicker").date(date);
 });
Comment

add 1 year to given date in javascript

var d = new Date();
    var year = d.getFullYear();
    var month = d.getMonth();
    var day = d.getDate();
    var c = new Date(year);
    console.log(c);
 Run code snippetHide results
Comment

add 1 year to current date javascript


// => Wed Dec 31 1969 16:00:02 GMT-0800 (PST)

Comment

PREVIOUS NEXT
Code Example
Javascript :: reversing an array in js 
Javascript :: console.time js 
Javascript :: how to call a javascript function in html without any event 
Javascript :: js stop scrolling event 
Javascript :: Get Current Date And Time In Node.js 
Javascript :: get ckeditor textarea value in jquery 
Javascript :: identify unused node modules 
Javascript :: html print div 
Javascript :: momentjs date and time string add minutes 
Javascript :: add font awesome to vue 
Javascript :: conditionally set checkbox state in React 
Javascript :: js get current date 
Javascript :: telegraf js sendmessage 
Javascript :: can we use two versions of jquery in same page 
Javascript :: react/ionic ion-app undefined 
Javascript :: adonis join condition 
Javascript :: useevent hook in react18 
Javascript :: remove attribute disabled 
Javascript :: ajax call with form data 
Javascript :: jquery select child span 
Javascript :: javascript close current tab 
Javascript :: convert firebase timestamp to date js 
Javascript :: javascript check if first of type 
Javascript :: console message inspector javascript 
Javascript :: how to delay execution in nodejs 
Javascript :: jquery move element 
Javascript :: js nested backticks 
Javascript :: onclick focus out jquery 
Javascript :: unpacking array javascript 
Javascript :: how to get cwd nodejs 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =