javascript - How to get a month in different format in jquery -


this question has answer here:

i using datepicker select dates calendar , works fine. however, dates given in numbered format when alert them: eg: 5-4-2017

how can month in wording instead? eg: 5-apr-2017

the jquery looks this:

$("#txtto").datepicker({     numberofmonths: 1,     onselect: function(selected) {       txttodate = selected;       var dt = new date(selected);       dt.setdate(dt.getdate() - 1);       $("#txtfrom").datepicker("option", "maxdate", dt);     } }); 

and used dates:

var date1 = $("#txtfrom").datepicker('getdate'), day_1  = date1.getdate(),   month_1 = date1.getmonth() + 1,               year_1 =  date1.getfullyear(); 

how can month in different format?

hope can , here pen if needed


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -