https://github.com/anders/ics
very simple iCal encoder for Go
https://github.com/anders/ics
Last synced: 3 months ago
JSON representation
very simple iCal encoder for Go
- Host: GitHub
- URL: https://github.com/anders/ics
- Owner: anders
- License: mit
- Created: 2020-01-22T12:13:28.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-03T04:38:36.000Z (about 6 years ago)
- Last Synced: 2024-12-27T14:14:33.641Z (about 1 year ago)
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ics
This is a simple module to generate iCalendar (ics) files. The API is subject
to change. Currently supports `VCALENDAR` and `VEVENT`.
## Example program
```go
import (
"github.com/anders/ics"
)
func main() {
cal := ics.NewCalendar()
cal.Add(ics.Event{
"DTSTART": time.Now(),
"DTEND": time.Now().Add(45*time.Minute),
"SUMMARY": "Hello World",
})
cal.Encode(os.Stdout)
}
```
output:
```
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//github.com/anders/ics
CALSCAL:GREGORIAN
BEGIN:VEVENT
DTEND:20200127T191212Z
DTSTART:20200127T182712Z
SUMMARY:Hello World
END:VEVENT
END:VCALENDAR
```