<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
<script type="text/javascript">
$(function()
{
var year;
$("#datepicker1").datepicker(
{
onSelect: function(dateText, inst)
{
var date = $(this).datepicker('getDate'),
day = date.getDate(),
month = date.getMonth(),
year = date.getFullYear();
year1 = date.getFullYear();
if (month < 3)
{
yearyear = year - 1;
year1year1 = year1.toString().substring(2);
}
else
{
yearyear = year;
year1 = (year1 + 1).toString().substring(2);;
}
$("#datepicker1").val(year + '-' + year1);
},
});
});
</script>
</head>
<body>
<input type="text" id="datepicker1" /> </body>
</html>This code snippet for Show financial year using jquery datepicker.
