Skip to content

Commit

Permalink
feat(ics): allow providing .ics filename, without relying on title
Browse files Browse the repository at this point in the history
  • Loading branch information
prystupa authored and jshor committed Jan 5, 2021
1 parent ad356ed commit 9fc3314
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion docs/docs/icalendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ DTSTAMP:20200916
PRODID:datebook.dev
```

## `download()`
## `download(fileName?: string)`

* **`fileName: string`** - optional file name

Downloads a `.ics` file on the user's browser for use in local calendars and email clients.
6 changes: 3 additions & 3 deletions src/ICalendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ export default class ICalendar extends CalendarBase {
*
* @remark Only works in browsers.
*
* @param {string} filename optional explicit filename, if not provided then will be constructed from title
* @param {string} fileName optional explicit file name, if not provided then will be constructed from title
*/
public download = (filename?: string): void => {
ics.download(filename || ics.getFileName(this.title), this.render())
public download = (fileName?: string): void => {
ics.download(fileName || ics.getFileName(this.title), this.render())
}

/**
Expand Down

0 comments on commit 9fc3314

Please sign in to comment.