Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/base/jquery-ui.css" rel="stylesheet" />
<script class="jsbin" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
  article, aside, figure, footer, header, hgroup, 
  menu, nav, section { display: block; }
</style>
</head>
<body>
  <input id="datepicker" type="text" />
   <input id="datepickerprev" type="text" />
</body>
</html>
 
jQuery(function ($) {
  
  var d = new Date();
  d.setMonth(d.getMonth() - 2);
  
  var day         = new Date(),
        year        = (day.getYear()-1),
        month       = day.getMonth(),
        date       = day.getDate() + '-' + month + '-' + year;
    $('#datepicker').datepicker({
      dateFormat  : 'dd-mm-yy',
      'setDate': '-10d'
        
    }).val(date);
   $('#datepickerprev').datepicker({
      dateFormat : 'dd-mm-yy',
      'setDate': '-11d',
        
    }).val(date);
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers