Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_issues_calendar.ics.ruby « issues « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3563635d33db2b823ebe702170a987ca4b54979d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
cal = Icalendar::Calendar.new
cal.prodid = '-//GitLab//NONSGML GitLab//EN'
cal.x_wr_calname = 'GitLab Issues'

@issues.includes(project: :namespace).each do |issue|
  cal.event do |event|
    event.dtstart     = Icalendar::Values::Date.new(issue.due_date)
    event.summary     = "#{issue.title} (in #{issue.project.full_path})"
    event.description = "Find out more at #{issue_url(issue)}"
    event.url         = issue_url(issue)
    event.transp      = 'TRANSPARENT'
  end
end

cal.to_ical