Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added cut filter
  • Loading branch information
dryan committed Jun 7, 2011
1 parent eeb0bd1 commit aa3c1f0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions django-filters.js
Expand Up @@ -288,6 +288,11 @@ if(!window['django']) {
return django.filters.date(date, format || django.filters.date.defaultFormats.time);
}

django.filters.cut = function(str, toCut) {
var regex = new RegExp(toCut, 'g');
return String(str).replace(regex, '');
}

django.filters.date.defaultFormats = {
'date': 'N j, Y',
'time': 'P'
Expand Down

0 comments on commit aa3c1f0

Please sign in to comment.