Last active
November 12, 2018 17:13
-
-
Save janniks/aad94ab1f66717a0fc866b82aceba1a3 to your computer and use it in GitHub Desktop.
BitBar - Sprint number and remaining days
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'date' | |
def getSprintNumber(date) | |
shifted = date - 1 # shift date (sprint starts on tuesday) | |
weeknumber = shifted.cweek + 1 # adjust for you sprint numbering | |
weeknumber /= 2 # two week sprints | |
weeknumber.ceil | |
end | |
sprintnumber = getSprintNumber(Date.today) | |
days_remaining = 0 | |
date = Date.today | |
while (days_remaining < 14) | |
date += 1 | |
days_remaining += 1 if !date.saturday? && !date.sunday? | |
break if getSprintNumber(date) != sprintnumber | |
end | |
puts "Sprint #{sprintnumber} - #{days_remaining}d" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
BitBar - Sprint number and remaining days
For all the BitBar users out there
➡️ This script shows the current sprint number and the remaining working days left in the sprint.
Install
Information
This script assumes you work with two week sprints that start/end on Tuesday - it should be very easy to alter for your needs.