This commit is contained in:
Radek 2012-09-24 17:20:14 +01:00
parent 1dac22aa17
commit 77b8f7c6c6
4 changed files with 30 additions and 12 deletions

View File

@ -41,6 +41,14 @@ Then assign a few labels to tickets in this Milestone. These labels will represe
size 5
```
### Weekends
If you have days when you do not work on a project, edit the `config.yml` file with a list of days of the week when you are off. The numbers are 1 indexed and follow the international standard of starting a week on Monday, so for a Saturday and Sunday weekend do this:
```yaml
weekend: [ 6, 7 ]
```
## Use:
```bash

View File

@ -104,12 +104,20 @@ app.get '/burndown', (req, res) ->
days = {} ; totalDays = 0 ; totalNonWorkingDays = 0
day = Issues.dateToTime current.milestone.created_at
while day < current.due
# Is this a weekend?
dayOfWeek = new Date(day).getDay()
if dayOfWeek is 6 or dayOfWeek is 0
totalNonWorkingDays += 1
# Save the day.
days[day] = { 'issues': [], 'actual': 0, 'ideal': 0, 'weekend': true }
# Do we have weekends configured?
if Issues.config.weekend? and Issues.config.weekend instanceof Array
dayOfWeek = new Date(day).getDay()
# Fix stupid Abrahamic tradition.
if dayOfWeek is 0 then dayOfWeek = 7
# Does this day fall on a weekend?
if dayOfWeek in Issues.config.weekend
totalNonWorkingDays += 1
# Save the day.
days[day] = { 'issues': [], 'actual': 0, 'ideal': 0, 'weekend': true }
else
# Save the day.
days[day] = { 'issues': [], 'actual': 0, 'ideal': 0, 'weekend': false }
else
# Save the day.
days[day] = { 'issues': [], 'actual': 0, 'ideal': 0, 'weekend': false }

View File

@ -1,3 +1,4 @@
github_user: 'intermine'
github_project: 'intermine'
project_name: 'current InterMine milestone'
project_name: 'Core InterMine Project'
weekend: [ 6, 7 ]

View File

@ -1,13 +1,14 @@
{
"name": "github-burndown-chart"
, "version": "0.1.1"
, "private": true
, "dependencies": {
"name": "github-burndown-chart",
"version": "0.1.2",
"private": true,
"dependencies": {
"coffee-script": "1.3.3",
"express": ">= 3.0",
"eco": "latest",
"js-yaml": "latest"
}, "scripts": {
},
"scripts": {
"start": "./node_modules/.bin/coffee app.coffee"
}
}