Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Commit

Permalink
Remove unused date ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
justincampbell committed Feb 21, 2013
1 parent f746891 commit 0c8ddab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/scripts/whoisout.coffee
Expand Up @@ -56,21 +56,21 @@ plugin.parseDate = (fuzzyDateString)->
return date
else
if (@thisDate = (moment fuzzyDateString)).isValid()
return {start: @thisDate.toDate(), end: null}
return @thisDate.toDate()
else
return false

plugin.save = (robot, vacationDateRange, msg)->
plugin.save = (robot, date, msg)->
userOutList = robot.brain.data.outList
userVacation = _(userOutList).find (item)-> item.name is msg.user.name

if userVacation is undefined
userOutList.push
name: msg.user.name
dates: [vacationDateRange.start]
dates: [date]
else
unless _(userVacation.dates).some( (item)-> (moment item).format('M/D/YY') is (moment vacationDateRange.start).format('M/D/YY'))
userVacation.dates.push vacationDateRange.start
unless _(userVacation.dates).some( (item)-> (moment item).format('M/D/YY') is (moment date).format('M/D/YY'))
userVacation.dates.push date

plugin.getAbsentees = (robot, targetDate)->
targetDate = new Date() unless targetDate?
Expand Down

0 comments on commit 0c8ddab

Please sign in to comment.