I want to get financial year by using Jquery, Check the example as i have 12 fields and every field is having a month name and in the same row it also shows the 1st and last date of month, some how i reached at the point but unable to get such results.
var theMonths = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
for (i = 0; i < 12; i++) {
var date = new Date();
var firstDay = new Date(date.getFullYear(), date.getMonth(theMonths[i]), 1);
var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
var months = '<li class="' + theMonths[i] + '">' + theMonths[i] + ' - - - - - - ' + firstDay + '---------' + lastDay + '</li>';
$('.calenderYear .month').append(months);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="calenderYear">
<ul class="month"></ul>
<span class="dates"></span>
</div>