Skip to content

Commit

Permalink
Use jquery.uniqueSort in supported jquery versions
Browse files Browse the repository at this point in the history
  • Loading branch information
acrobat committed Aug 4, 2016
1 parent 0735231 commit df4542c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion js/bootstrap-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,14 @@
tooltip = before.tooltip;
}

clsName = $.unique(clsName);
//Check if uniqueSort exists (supported by jquery >=1.12 and >=2.2)
//Fallback to unique function for older jquery versions
if ($.isFunction($.uniqueSort)) {
clsName = $.uniqueSort(clsName);
} else {
clsName = $.unique(clsName);
}

html.push('<td class="'+clsName.join(' ')+'"' + (tooltip ? ' title="'+tooltip+'"' : '') + '>'+prevMonth.getUTCDate() + '</td>');
tooltip = null;
if (prevMonth.getUTCDay() === this.o.weekEnd){
Expand Down

0 comments on commit df4542c

Please sign in to comment.