add view functions and(), or(), notEqual()

This commit is contained in:
Tyler Renelle
2013-03-16 19:10:40 -04:00
parent 081c5c656f
commit 903479af5a
+6 -1
View File
@@ -1,4 +1,5 @@
moment = require('moment')
moment = require 'moment'
_ = require 'underscore'
# Absolute diff between two dates
module.exports.daysBetween = (yesterday, now, dayStart) ->
@@ -37,4 +38,8 @@ module.exports.viewHelpers = (view) ->
loc = window?.location.host or process.env.BASE_URL
encodeURIComponent "http://#{loc}/v1/users/#{uid}/calendar.ics?apiToken=#{apiToken}"
view.fn "notEqual", (a, b) -> (a != b)
view.fn "and", -> _.reduce arguments, (cumm, curr) -> cumm && curr
view.fn "or", -> _.reduce arguments, (cumm, curr) -> cumm || curr