Skip to content

Instantly share code, notes, and snippets.

@janniks
Last active November 12, 2018 17:13
Show Gist options
  • Save janniks/aad94ab1f66717a0fc866b82aceba1a3 to your computer and use it in GitHub Desktop.
Save janniks/aad94ab1f66717a0fc866b82aceba1a3 to your computer and use it in GitHub Desktop.
BitBar - Sprint number and remaining days
#!/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"
@janniks
Copy link
Author

janniks commented Oct 31, 2018

BitBar - Sprint number and remaining days

For all the BitBar users out there
Finder showing script file with BitBar showing in macOS menu bar

➡️ This script shows the current sprint number and the remaining working days left in the sprint.

Install

  1. Install BitBar (Consider using @oleander's BitBar version - you can download it here)
  2. Download this script
  3. Place it in your BitBar folder (it will run every day automatically)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment