date is a value from a jquery datepicker, I am wanting to return the last date of the next month if > 27th is picked in the datepicker, but the below is always selecting the last day of the next month whether its > the 27th or not?

```
if (date > date.getMonth(date.getDate() + 0, 27))
{
    date.setMonth(date.getMonth() + 2, 0);
}
else {
    date.setMonth(date.getMonth() + 1);
}

```