Skip to content

Instantly share code, notes, and snippets.

@ajacksified
ajacksified / days_since.coffee
Created January 18, 2012 23:59 — forked from zenhob/days_since.coffee
hubot script for tracking days since an event
# Generates commands to track days since an event
#
# it's been <number> days since <event> - Set the day when the event happened
# <event> on <date> - Set the date the event happened (yyyy-mm-dd)
# how long since <event>? - Display the number of days since the event
# when was/is/did <event>?
module.exports = (robot) ->
robot.respond /(.*?) on ((19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01]))$/, (msg) ->
event = msg.match[1]