summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/calendar.js.coffee
blob: 6a0d5e43567dd5e97b29a9dc44620f3d46ff4335 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class @calendar
  options =
    month: "short"
    day: "numeric"
    year: "numeric"

  constructor: (timestamps, starting_year, starting_month) ->
    cal = new CalHeatMap()
    cal.init
      itemName: ["commit"]
      data: timestamps
      domain: "year"
      subDomain: "month"
      start: new Date(starting_year, starting_month)
      domainLabelFormat: "%b"
      id: "cal-heatmap"
      domain: "month"
      subDomain: "day"
      range: 12
      tooltip: true
      domainDynamicDimension: false
      colLimit: 4
      label:
        position: "top"
      domainMargin: 1
      legend: [
        0
        1
        4
        7
      ]
      legendCellPadding: 3
      onClick: (date, count) ->
        return
    return