0

Ok so I have the following:

var alldatesdump = booking.getalldates();

var alldatesdumparray = $.map(booking.getalldates(), function(value, index) {
    var splitstring
    var dropdates = new Date(value.date);
    var dropdate = dropdates.getDate();
    var month=new Array();
month[0]="January";
month[1]="February";
month[2]="March";
month[3]="April";
month[4]="May";
month[5]="June";
month[6]="July";
month[7]="August";
month[8]="September";
month[9]="October";
month[10]="November";
month[11]="December";
    var dropmonth = month[dropdates.getMonth()];
    var dropyear = dropdates.getFullYear();
console.log(dropmonth + "-" + dropyear);

    return [value];
});

which outputs the following:

October-2014 
October-2014 
October-2014 
November-2014 
November-2014 
November-2014 

how do i stop it from repeating values and just out put once per month.... Chris

2
  • 1
    possible duplicate of jQuery - Finding Distinct Values in Object Array Commented Jan 14, 2014 at 13:33
  • thank you i search high and low and just did not come up with that answer! Commented Jan 14, 2014 at 13:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.