Add filter for enterprises within a radius

This commit is contained in:
Rohan Mitchell
2015-07-03 10:43:40 +10:00
parent 46792a4111
commit f154a02c86
2 changed files with 22 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
Darkswarm.filter 'distanceWithinKm', ->
(enterprises, range) ->
enterprises ||= []
enterprises.filter (enterprise) ->
enterprise.distance / 1000 <= range