{"id":21820299,"url":"https://github.com/trademe/ngaddtocalendar","last_synced_at":"2025-04-14T02:44:27.551Z","repository":{"id":31470811,"uuid":"127995436","full_name":"TradeMe/ngAddToCalendar","owner":"TradeMe","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-03T15:01:46.000Z","size":671,"stargazers_count":5,"open_issues_count":18,"forks_count":4,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-11T13:37:21.567Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TradeMe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-04T02:26:54.000Z","updated_at":"2022-01-17T14:29:09.000Z","dependencies_parsed_at":"2024-06-21T19:33:19.948Z","dependency_job_id":"28ada34f-f6aa-4be5-919c-2fa29d41d871","html_url":"https://github.com/TradeMe/ngAddToCalendar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TradeMe%2FngAddToCalendar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TradeMe%2FngAddToCalendar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TradeMe%2FngAddToCalendar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TradeMe%2FngAddToCalendar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TradeMe","download_url":"https://codeload.github.com/TradeMe/ngAddToCalendar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248812761,"owners_count":21165473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-27T16:31:07.029Z","updated_at":"2025-04-14T02:44:27.532Z","avatar_url":"https://github.com/TradeMe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ngAddToCalendar\nAngular library to add custom events to common calendar applications (Google Calendar, iCalendar, Outlook, Outlook Live and Yahoo).\n\n## Install\n\n```\nnpm install @trademe/ng-add-to-calendar\n```\n\n## Use\n\nImport NgAddToCalendarModule into your main app module.\n\n```\nimport { NgAddToCalendarModule } from '@trademe/ng-add-to-calendar';\n\n@NgModule({\n  imports: [\n    NgAddToCalendarModule\n  ]\n})\nexport class AppModule { }\n```\n\nImport NgAddToCalendarService and ICalendarEvent into your component. \nImport SafeUrl and DomSanitizer for creating usable urls in your template.\n\nCreate a new event.\n\n```\nimport { NgAddToCalendarService, ICalendarEvent } from '@trademe/ng-add-to-calendar';\nimport { SafeUrl, DomSanitizer } from '@angular/platform-browser';\n\npublic googleCalendarEventUrl: SafeUrl;\npublic newEvent: ICalendarEvent;\n\nconstructor(\n    private _addToCalendarService: NgAddToCalendarService,\n    private _sanitizer: DomSanitizer\n) {\n    this.newEvent = {\n        // Event title\n        title: 'My event title',\n        // Event start date\n        start: new Date('June 15, 2013 19:00'),\n        // Event duration (IN MINUTES)\n        duration: 120,\n        // If an end time is set, this will take precedence over duration (optional)\n        end: new Date('June 15, 2013 23:00'),\n        // Event Address (optional)\n        address: '1 test street, testland',\n        // Event Description (optional)\n        description: 'An awesome event'\n    };\n}\n```\n\nTo create line breaks in your event descriptions use '\\\\n' for a new line, or '\\\\n\\\\n' for a hard return.\n\n```\nthis.newEvent = {\n    ...\n    description: 'An awesome event.\\\\nWith line breaks!\\\\n\\\\nSweet'\n};\n```\n\nUse the addToCalendarService in your component to create a safeUrl passing the newEvent you created.\nEvent configuration is the same for each available calendar type (google, iCalendar, outlook, outlookLive, yahoo).\n\n```\nthis.googleCalendarEventUrl = this._sanitizer.bypassSecurityTrustUrl(\n    this._addToCalendarService.getHrefFor(this._addToCalendarService.calendarType.google, this.newEvent)\n);\n```\n\nUse the url in your template.\n\n```\n\u003ca [href]=\"googleCalendarEventUrl\" target=\"_blank\"\u003eGoogle Calendar Event\u003c/a\u003e\n```\n\n## License\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrademe%2Fngaddtocalendar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrademe%2Fngaddtocalendar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrademe%2Fngaddtocalendar/lists"}