New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

calendar-link

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

calendar-link - npm Package Compare versions

Comparing version 2.4.0 to 2.5.0

dist/index.modern.mjs

9

CHANGELOG.md

@@ -0,1 +1,10 @@

## v2.5.0 (2023-07-12)
[📝 Release notes](https://github.com/AnandChowdhary/calendar-link/releases/tag/v2.5.0) · [💻 Compare](https://github.com/AnandChowdhary/calendar-link/compare/v2.4.0...v2.5.0) · [🔖 Tag](https://github.com/AnandChowdhary/calendar-link/tree/v2.5.0) · 🗄️ Archive ([zip](https://github.com/AnandChowdhary/calendar-link/archive/v2.5.0.zip) · [tar.gz](https://github.com/AnandChowdhary/calendar-link/archive/v2.5.0.tar.gz))
### ✨ New features
- [`4828504`](https://github.com/AnandChowdhary/calendar-link/commit/4828504) Use ubuntu-latest for CI
- [`0ac72d5`](https://github.com/AnandChowdhary/calendar-link/commit/0ac72d5) Release new version
## v2.4.0 (2022-10-21)

@@ -2,0 +11,0 @@

3

dist/index.d.ts

@@ -5,5 +5,8 @@ import { CalendarEvent, NormalizedCalendarEvent } from "./interfaces";

export declare const outlook: (calendarEvent: CalendarEvent) => string;
export declare const outlookMobile: (calendarEvent: CalendarEvent) => string;
export declare const office365: (calendarEvent: CalendarEvent) => string;
export declare const office365Mobile: (calendarEvent: CalendarEvent) => string;
export declare const yahoo: (calendarEvent: CalendarEvent) => string;
export declare const aol: (calendarEvent: CalendarEvent) => string;
export declare const ics: (calendarEvent: CalendarEvent) => string;
export { CalendarEvent };

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.ics = exports.yahoo = exports.office365 = exports.outlook = exports.google = exports.eventify = void 0;
exports.ics = exports.aol = exports.yahoo = exports.office365Mobile = exports.office365 = exports.outlookMobile = exports.outlook = exports.google = exports.eventify = void 0;
const dayjs_1 = __importDefault(require("dayjs"));

@@ -73,5 +73,21 @@ const utc_1 = __importDefault(require("dayjs/plugin/utc"));

};
return `https://outlook.live.com/calendar/0/action/compose?${(0, query_string_1.stringify)(details)}`;
};
exports.outlook = outlook;
const outlookMobile = (calendarEvent) => {
const event = (0, exports.eventify)(calendarEvent, false);
const { start, end } = formatTimes(event, "dateTimeLocal");
const details = {
path: "/calendar/action/compose",
rru: "addevent",
startdt: start,
enddt: end,
subject: event.title,
body: event.description,
location: event.location,
allday: event.allDay || false,
};
return `https://outlook.live.com/calendar/0/deeplink/compose?${(0, query_string_1.stringify)(details)}`;
};
exports.outlook = outlook;
exports.outlookMobile = outlookMobile;
const office365 = (calendarEvent) => {

@@ -90,5 +106,21 @@ const event = (0, exports.eventify)(calendarEvent, false);

};
return `https://outlook.office.com/calendar/0/action/compose?${(0, query_string_1.stringify)(details)}`;
};
exports.office365 = office365;
const office365Mobile = (calendarEvent) => {
const event = (0, exports.eventify)(calendarEvent, false);
const { start, end } = formatTimes(event, "dateTimeLocal");
const details = {
path: "/calendar/action/compose",
rru: "addevent",
startdt: start,
enddt: end,
subject: event.title,
body: event.description,
location: event.location,
allday: event.allDay || false,
};
return `https://outlook.office.com/calendar/0/deeplink/compose?${(0, query_string_1.stringify)(details)}`;
};
exports.office365 = office365;
exports.office365Mobile = office365Mobile;
const yahoo = (calendarEvent) => {

@@ -109,2 +141,17 @@ const event = (0, exports.eventify)(calendarEvent);

exports.yahoo = yahoo;
const aol = (calendarEvent) => {
const event = (0, exports.eventify)(calendarEvent);
const { start, end } = formatTimes(event, event.allDay ? "allDay" : "dateTimeUTC");
const details = {
v: 60,
title: event.title,
st: start,
et: end,
desc: event.description,
in_loc: event.location,
dur: event.allDay ? "allday" : false,
};
return `https://calendar.aol.com/?${(0, query_string_1.stringify)(details)}`;
};
exports.aol = aol;
const ics = (calendarEvent) => {

@@ -111,0 +158,0 @@ const event = (0, exports.eventify)(calendarEvent);

296

dist/index.spec.js
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const dayjs_1 = __importDefault(require("dayjs"));
const index_1 = require("./index");
const utils_1 = require("./utils");
describe("Calendar Links", () => {
describe("Google", () => {
test("generate a google link", () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
duration: [2, "hour"],
};
const link = (0, index_1.google)(event);
const sTime = (0, dayjs_1.default)(event.start).utc().format(utils_1.TimeFormats.dateTimeUTC);
const eTime = (0, dayjs_1.default)(event.start).add(2, "hour").utc().format(utils_1.TimeFormats.dateTimeUTC);
const expectedDates = encodeURIComponent(`${sTime}/${eTime}`);
expect(link).toBe(`https://calendar.google.com/calendar/render?action=TEMPLATE&dates=${expectedDates}&text=Birthday%20party`);
});
test("generate a google link with time & timezone", () => {
const event = {
title: "Birthday party",
start: "2019-12-29T12:00:00.000+01:00",
duration: [2, "hour"],
};
const link = (0, index_1.google)(event);
const sTime = (0, dayjs_1.default)(event.start).utc().format(utils_1.TimeFormats.dateTimeUTC);
const eTime = (0, dayjs_1.default)(event.start).add(2, "hour").utc().format(utils_1.TimeFormats.dateTimeUTC);
const expectedDates = encodeURIComponent(`${sTime}/${eTime}`);
expect(link).toBe(`https://calendar.google.com/calendar/render?action=TEMPLATE&dates=${expectedDates}&text=Birthday%20party`);
});
test("generate an all day google link", () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
allDay: true,
};
const link = (0, index_1.google)(event);
const sTime = (0, dayjs_1.default)(event.start).utc().format(utils_1.TimeFormats.allDay);
const eTime = (0, dayjs_1.default)(event.start).add(1, "day").utc().format(utils_1.TimeFormats.allDay);
const expectedDates = encodeURIComponent(`${sTime}/${eTime}`);
expect(link).toBe(`https://calendar.google.com/calendar/render?action=TEMPLATE&dates=${expectedDates}&text=Birthday%20party`);
});
test("generate a multi day google link", () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
end: "2020-01-12",
allDay: true,
};
const link = (0, index_1.google)(event);
const sTime = (0, dayjs_1.default)(event.start).utc().format(utils_1.TimeFormats.allDay);
const eTime = (0, dayjs_1.default)(event.end).utc().format(utils_1.TimeFormats.allDay);
const expectedDates = encodeURIComponent(`${sTime}/${eTime}`);
expect(link).toBe(`https://calendar.google.com/calendar/render?action=TEMPLATE&dates=${expectedDates}&text=Birthday%20party`);
});
test("generate a recurring google link", () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
duration: [2, "hour"],
rRule: "FREQ=YEARLY;INTERVAL=1",
};
const link = (0, index_1.google)(event);
const sTime = (0, dayjs_1.default)(event.start).utc().format(utils_1.TimeFormats.dateTimeUTC);
const eTime = (0, dayjs_1.default)(event.start).add(2, "hour").utc().format(utils_1.TimeFormats.dateTimeUTC);
const expectedDates = encodeURIComponent(`${sTime}/${eTime}`);
expect(link).toBe(`https://calendar.google.com/calendar/render?action=TEMPLATE&dates=${expectedDates}&recur=RRULE%3AFREQ%3DYEARLY%3BINTERVAL%3D1&text=Birthday%20party`);
});
test("generate a google link with guests", () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
duration: [2, "hour"],
guests: ["hello@example.com", "another@example.com"],
};
const link = (0, index_1.google)(event);
const sTime = (0, dayjs_1.default)(event.start).utc().format(utils_1.TimeFormats.dateTimeUTC);
const eTime = (0, dayjs_1.default)(event.start).add(2, "hour").utc().format(utils_1.TimeFormats.dateTimeUTC);
const expectedDates = encodeURIComponent(`${sTime}/${eTime}`);
const expectedGuests = encodeURIComponent(event.guests ? event.guests.join() : "");
expect(link).toBe(`https://calendar.google.com/calendar/render?action=TEMPLATE&add=${expectedGuests}&dates=${expectedDates}&text=Birthday%20party`);
});
for (const service of [
index_1.aol,
index_1.google,
index_1.ics,
index_1.office365,
index_1.office365Mobile,
index_1.outlook,
index_1.outlookMobile,
index_1.yahoo,
]) {
describe(`${service.name} service`, () => { });
test(`generate a ${service.name} link`, () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
duration: [2, "hour"],
};
const link = service(event);
expect(link).toMatchSnapshot();
});
describe("Yahoo", () => {
test("generate a yahoo link", () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
duration: [2, "hour"],
};
const link = (0, index_1.yahoo)(event);
const sTime = (0, dayjs_1.default)(event.start).utc().format(utils_1.TimeFormats.dateTimeUTC);
const eTime = (0, dayjs_1.default)(event.start).add(2, "hour").utc().format(utils_1.TimeFormats.dateTimeUTC);
expect(link).toBe(`https://calendar.yahoo.com/?dur=false&et=${eTime}&st=${sTime}&title=Birthday%20party&v=60`);
});
test("generate an all day yahoo link", () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
allDay: true,
};
const link = (0, index_1.yahoo)(event);
const sTime = (0, dayjs_1.default)(event.start).utc().format(utils_1.TimeFormats.allDay);
const eTime = (0, dayjs_1.default)(event.start).add(1, "day").utc().format(utils_1.TimeFormats.allDay);
expect(link).toBe(`https://calendar.yahoo.com/?dur=allday&et=${eTime}&st=${sTime}&title=Birthday%20party&v=60`);
});
test(`generate a ${service.name} link with time & timezone`, () => {
const event = {
title: "Birthday party",
start: "2019-12-29T12:00:00.000+01:00",
duration: [2, "hour"],
};
const link = service(event);
expect(link).toMatchSnapshot();
});
describe("Outlook", () => {
test("generate a outlook link", () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
duration: [2, "hour"],
};
const link = (0, index_1.outlook)(event);
expect(link).toBe(`https://outlook.live.com/calendar/0/deeplink/compose?allday=false&enddt=2019-12-29T02%3A00%3A00&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt=2019-12-29T00%3A00%3A00&subject=Birthday%20party`);
});
test("generate an all day outlook link", () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
allDay: true,
};
const link = (0, index_1.outlook)(event);
expect(link).toBe(`https://outlook.live.com/calendar/0/deeplink/compose?allday=true&enddt=2019-12-30T00%3A00%3A00&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt=2019-12-29T00%3A00%3A00&subject=Birthday%20party`);
});
test(`generate an all day ${service.name} link`, () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
allDay: true,
};
const link = service(event);
expect(link).toMatchSnapshot();
});
describe("Office365", () => {
test("generate a office365 link", () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
duration: [2, "hour"],
};
const link = (0, index_1.office365)(event);
expect(link).toBe(`https://outlook.office.com/calendar/0/deeplink/compose?allday=false&enddt=2019-12-29T02%3A00%3A00&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt=2019-12-29T00%3A00%3A00&subject=Birthday%20party`);
});
test("generate an all day office365 link", () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
allDay: true,
};
const link = (0, index_1.office365)(event);
expect(link).toBe(`https://outlook.office.com/calendar/0/deeplink/compose?allday=true&enddt=2019-12-30T00%3A00%3A00&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt=2019-12-29T00%3A00%3A00&subject=Birthday%20party`);
});
test(`generate a multi day ${service.name} link`, () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
end: "2020-01-12",
allDay: true,
};
const link = service(event);
expect(link).toMatchSnapshot();
});
describe("ICS", () => {
test("should generate an all day ics link", () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
allDay: true,
};
const sTime = (0, dayjs_1.default)(event.start).utc().format(utils_1.TimeFormats.allDay);
const eTime = (0, dayjs_1.default)(event.start).add(1, "day").utc().format(utils_1.TimeFormats.allDay);
const link = (0, index_1.ics)(event);
expect(link).toBe(`data:text/calendar;charset=utf8,BEGIN:VCALENDAR%0AVERSION:2.0%0ABEGIN:VEVENT%0ADTSTART:${sTime}%0ADTEND:${eTime}%0ASUMMARY:Birthday%20party%0AEND:VEVENT%0AEND:VCALENDAR%0A`);
});
test("should generate an ics link", () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
duration: [2, "day"],
};
const sTime = (0, dayjs_1.default)(event.start).utc().format(utils_1.TimeFormats.dateTimeUTC);
const eTime = (0, dayjs_1.default)(event.start).add(2, "day").utc().format(utils_1.TimeFormats.dateTimeUTC);
const link = (0, index_1.ics)(event);
expect(link).toBe(`data:text/calendar;charset=utf8,BEGIN:VCALENDAR%0AVERSION:2.0%0ABEGIN:VEVENT%0ADTSTART:${sTime}%0ADTEND:${eTime}%0ASUMMARY:Birthday%20party%0AEND:VEVENT%0AEND:VCALENDAR%0A`);
});
test("should generate an ics link with end date", () => {
const event = {
title: "Birthday party",
start: "2019-12-23",
end: "2019-12-29",
};
const sTime = (0, dayjs_1.default)(event.start).utc().format(utils_1.TimeFormats.dateTimeUTC);
const eTime = (0, dayjs_1.default)(event.end).utc().format(utils_1.TimeFormats.dateTimeUTC);
const link = (0, index_1.ics)(event);
expect(link).toBe(`data:text/calendar;charset=utf8,BEGIN:VCALENDAR%0AVERSION:2.0%0ABEGIN:VEVENT%0ADTSTART:${sTime}%0ADTEND:${eTime}%0ASUMMARY:Birthday%20party%0AEND:VEVENT%0AEND:VCALENDAR%0A`);
});
test("should generate an ics link with escaped characters", () => {
const event = {
title: "!#$%&'()*+,/:;=?@[] — Birthday party",
description: "!#$%&'()*+,/:;=?@[] — My birthday!",
location: "!#$%&'()*+,/:;=?@[] — My birthday!",
start: "2019-12-23",
end: "2019-12-29",
};
const sTime = (0, dayjs_1.default)(event.start).utc().format(utils_1.TimeFormats.dateTimeUTC);
const eTime = (0, dayjs_1.default)(event.end).utc().format(utils_1.TimeFormats.dateTimeUTC);
const link = (0, index_1.ics)(event);
expect(link).toBe(`data:text/calendar;charset=utf8,BEGIN:VCALENDAR%0AVERSION:2.0%0ABEGIN:VEVENT%0ADTSTART:${sTime}%0ADTEND:${eTime}%0ASUMMARY:!%23%24%25%26'()*%2B%2C%2F%3A%3B%3D%3F%40%5B%5D%20%E2%80%94%20Birthday%20party%0ADESCRIPTION:!%23%24%25%26'()*%2B%2C%2F%3A%3B%3D%3F%40%5B%5D%20%E2%80%94%20My%20birthday!%0ALOCATION:!%23%24%25%26'()*%2B%2C%2F%3A%3B%3D%3F%40%5B%5D%20%E2%80%94%20My%20birthday!%0AEND:VEVENT%0AEND:VCALENDAR%0A`);
});
test("should generate an all day ics link with a custom URL", () => {
const url = "https://example.com/birthday";
const event = {
title: "Birthday party",
start: "2019-12-29",
allDay: true,
url,
};
const sTime = (0, dayjs_1.default)(event.start).utc().format(utils_1.TimeFormats.allDay);
const eTime = (0, dayjs_1.default)(event.start).add(1, "day").utc().format(utils_1.TimeFormats.allDay);
const link = (0, index_1.ics)(event);
expect(link).toBe(`data:text/calendar;charset=utf8,BEGIN:VCALENDAR%0AVERSION:2.0%0ABEGIN:VEVENT%0AURL:${encodeURIComponent(url)}%0ADTSTART:${sTime}%0ADTEND:${eTime}%0ASUMMARY:Birthday%20party%0AEND:VEVENT%0AEND:VCALENDAR%0A`);
});
test("allDay should take precedence over duration", () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
allDay: true,
duration: [2, "day"],
};
const sTime = (0, dayjs_1.default)(event.start).utc().format(utils_1.TimeFormats.allDay);
const eTime = (0, dayjs_1.default)(event.start).add(1, "day").utc().format(utils_1.TimeFormats.allDay);
const link = (0, index_1.ics)(event);
expect(link).toBe(`data:text/calendar;charset=utf8,BEGIN:VCALENDAR%0AVERSION:2.0%0ABEGIN:VEVENT%0ADTSTART:${sTime}%0ADTEND:${eTime}%0ASUMMARY:Birthday%20party%0AEND:VEVENT%0AEND:VCALENDAR%0A`);
});
test("should generate an ics link with an organizer", () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
duration: [2, "day"],
organizer: {
name: "John Doe",
email: "john.doe@example.com",
},
};
const sTime = (0, dayjs_1.default)(event.start).utc().format(utils_1.TimeFormats.dateTimeUTC);
const eTime = (0, dayjs_1.default)(event.start).add(2, "day").utc().format(utils_1.TimeFormats.dateTimeUTC);
const link = (0, index_1.ics)(event);
expect(link).toBe(`data:text/calendar;charset=utf8,BEGIN:VCALENDAR%0AVERSION:2.0%0ABEGIN:VEVENT%0ADTSTART:${sTime}%0ADTEND:${eTime}%0ASUMMARY:Birthday%20party%0AORGANIZER;CN%3DJohn%20Doe%3AMAILTO%3Ajohn.doe%40example.com%0AEND:VEVENT%0AEND:VCALENDAR%0A`);
});
test(`generate a recurring ${service.name} link`, () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
duration: [2, "hour"],
rRule: "FREQ=YEARLY;INTERVAL=1",
};
const link = service(event);
expect(link).toMatchSnapshot();
});
});
test(`generate a ${service.name} link with guests`, () => {
const event = {
title: "Birthday party",
start: "2019-12-29",
duration: [2, "hour"],
guests: ["hello@example.com", "another@example.com"],
};
const link = service(event);
expect(link).toMatchSnapshot();
});
}
//# sourceMappingURL=index.spec.js.map

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t||self).calendarLink={})}(this,function(t){function e(){return(e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function r(t){var e={exports:{}};return t(e,e.exports),e.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var n=r(function(t,e){t.exports=function(){var t="millisecond",e="second",r="minute",n="hour",i="day",a="week",o="month",s="quarter",u="year",c="date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},h=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},p={s:h,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),i=r%60;return(e<=0?"+":"-")+h(n,2,"0")+":"+h(i,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),i=e.clone().add(n,o),a=r-i<0,s=e.clone().add(n+(a?-1:1),o);return+(-(n+(r-i)/(a?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(l){return{M:o,y:u,w:a,d:i,D:c,h:n,m:r,s:e,ms:t,Q:s}[l]||String(l||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",m={};m[y]=d;var g=function(t){return t instanceof O},$=function(t,e,r){var n;if(!t)return y;if("string"==typeof t)m[t]&&(n=t),e&&(m[t]=e,n=t);else{var i=t.name;m[i]=t,n=i}return!r&&n&&(y=n),n||!r&&y},v=function(t,e){if(g(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new O(r)},D=p;D.l=$,D.i=g,D.w=function(t,e){return v(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var O=function(){function d(t){this.$L=$(t.locale,null,!0),this.parse(t)}var h=d.prototype;return h.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(D.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(l);if(n){var i=n[2]-1||0,a=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},h.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},h.$utils=function(){return D},h.isValid=function(){return!("Invalid Date"===this.$d.toString())},h.isSame=function(t,e){var r=v(t);return this.startOf(e)<=r&&r<=this.endOf(e)},h.isAfter=function(t,e){return v(t)<this.startOf(e)},h.isBefore=function(t,e){return this.endOf(e)<v(t)},h.$g=function(t,e,r){return D.u(t)?this[e]:this.set(r,t)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(t,s){var l=this,f=!!D.u(s)||s,d=D.p(t),h=function(t,e){var r=D.w(l.$u?Date.UTC(l.$y,e,t):new Date(l.$y,e,t),l);return f?r:r.endOf(i)},p=function(t,e){return D.w(l.toDate()[t].apply(l.toDate("s"),(f?[0,0,0,0]:[23,59,59,999]).slice(e)),l)},y=this.$W,m=this.$M,g=this.$D,$="set"+(this.$u?"UTC":"");switch(d){case u:return f?h(1,0):h(31,11);case o:return f?h(1,m):h(0,m+1);case a:var v=this.$locale().weekStart||0,O=(y<v?y+7:y)-v;return h(f?g-O:g+(6-O),m);case i:case c:return p($+"Hours",0);case n:return p($+"Minutes",1);case r:return p($+"Seconds",2);case e:return p($+"Milliseconds",3);default:return this.clone()}},h.endOf=function(t){return this.startOf(t,!1)},h.$set=function(a,s){var l,f=D.p(a),d="set"+(this.$u?"UTC":""),h=(l={},l[i]=d+"Date",l[c]=d+"Date",l[o]=d+"Month",l[u]=d+"FullYear",l[n]=d+"Hours",l[r]=d+"Minutes",l[e]=d+"Seconds",l[t]=d+"Milliseconds",l)[f],p=f===i?this.$D+(s-this.$W):s;if(f===o||f===u){var y=this.clone().set(c,1);y.$d[h](p),y.init(),this.$d=y.set(c,Math.min(this.$D,y.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},h.set=function(t,e){return this.clone().$set(t,e)},h.get=function(t){return this[D.p(t)]()},h.add=function(t,s){var c,l=this;t=Number(t);var f=D.p(s),d=function(e){var r=v(l);return D.w(r.date(r.date()+Math.round(e*t)),l)};if(f===o)return this.set(o,this.$M+t);if(f===u)return this.set(u,this.$y+t);if(f===i)return d(1);if(f===a)return d(7);var h=(c={},c[r]=6e4,c[n]=36e5,c[e]=1e3,c)[f]||1,p=this.$d.getTime()+t*h;return D.w(p,this)},h.subtract=function(t,e){return this.add(-1*t,e)},h.format=function(t){var e=this;if(!this.isValid())return"Invalid Date";var r=t||"YYYY-MM-DDTHH:mm:ssZ",n=D.z(this),i=this.$locale(),a=this.$H,o=this.$m,s=this.$M,u=i.weekdays,c=i.months,l=function(t,n,i,a){return t&&(t[n]||t(e,r))||i[n].substr(0,a)},d=function(t){return D.s(a%12||12,t,"0")},h=i.meridiem||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n},p={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:D.s(s+1,2,"0"),MMM:l(i.monthsShort,s,c,3),MMMM:l(c,s),D:this.$D,DD:D.s(this.$D,2,"0"),d:String(this.$W),dd:l(i.weekdaysMin,this.$W,u,2),ddd:l(i.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(a),HH:D.s(a,2,"0"),h:d(1),hh:d(2),a:h(a,o,!0),A:h(a,o,!1),m:String(o),mm:D.s(o,2,"0"),s:String(this.$s),ss:D.s(this.$s,2,"0"),SSS:D.s(this.$ms,3,"0"),Z:n};return r.replace(f,function(t,e){return e||p[t]||n.replace(":","")})},h.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},h.diff=function(t,c,l){var f,d=D.p(c),h=v(t),p=6e4*(h.utcOffset()-this.utcOffset()),y=this-h,m=D.m(this,h);return m=(f={},f[u]=m/12,f[o]=m,f[s]=m/3,f[a]=(y-p)/6048e5,f[i]=(y-p)/864e5,f[n]=y/36e5,f[r]=y/6e4,f[e]=y/1e3,f)[d]||y,l?m:D.a(m)},h.daysInMonth=function(){return this.endOf(o).$D},h.$locale=function(){return m[this.$L]},h.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=$(t,e,!0);return n&&(r.$L=n),r},h.clone=function(){return D.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},d}(),M=O.prototype;return v.prototype=M,[["$ms",t],["$s",e],["$m",r],["$H",n],["$W",i],["$M",o],["$y",u],["$D",c]].forEach(function(t){M[t[1]]=function(e){return this.$g(e,t[0],t[1])}}),v.extend=function(t,e){return t.$i||(t(e,O,v),t.$i=!0),v},v.locale=$,v.isDayjs=g,v.unix=function(t){return v(1e3*t)},v.en=m[y],v.Ls=m,v.p={},v}()}),i=r(function(t,e){t.exports=function(t,e,r){var n=e.prototype;r.utc=function(t){return new e({date:t,utc:!0,args:arguments})},n.utc=function(t){var e=r(this.toDate(),{locale:this.$L,utc:!0});return t?e.add(this.utcOffset(),"minute"):e},n.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var i=n.parse;n.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),i.call(this,t)};var a=n.init;n.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else a.call(this)};var o=n.utcOffset;n.utcOffset=function(t,e){var r=this.$utils().u;if(r(t))return this.$u?0:r(this.$offset)?o.call(this):this.$offset;var n=Math.abs(t)<=16?60*t:t,i=this;if(e)return i.$offset=n,i.$u=0===t,i;if(0!==t){var a=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(i=this.local().add(n+a,"minute")).$offset=n,i.$x.$localOffset=a}else i=this.utc();return i};var s=n.format;n.format=function(t){return s.call(this,t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":""))},n.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||(new Date).getTimezoneOffset());return this.$d.valueOf()-6e4*t},n.isUTC=function(){return!!this.$u},n.toISOString=function(){return this.toDate().toISOString()},n.toString=function(){return this.toDate().toUTCString()};var u=n.toDate;n.toDate=function(t){return"s"===t&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():u.call(this)};var c=n.diff;n.diff=function(t,e,n){if(t&&this.$u===t.$u)return c.call(this,t,e,n);var i=this.local(),a=r(t).local();return c.call(i,a,e,n)}}}),a="%[a-f0-9]{2}",o=new RegExp(a,"gi"),s=new RegExp("("+a+")+","gi");function u(t,e){try{return decodeURIComponent(t.join(""))}catch(t){}if(1===t.length)return t;var r=t.slice(0,e=e||1),n=t.slice(e);return Array.prototype.concat.call([],u(r),u(n))}function c(t){try{return decodeURIComponent(t)}catch(n){for(var e=t.match(o),r=1;r<e.length;r++)e=(t=u(e,r).join("")).match(o);return t}}var l=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return function(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},r=s.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch(t){var n=c(r[0]);n!==r[0]&&(e[r[0]]=n)}r=s.exec(t)}e["%C2"]="�";for(var i=Object.keys(e),a=0;a<i.length;a++){var o=i[a];t=t.replace(new RegExp(o,"g"),e[o])}return t}(t)}},f=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];const r=t.indexOf(e);return-1===r?[t]:[t.slice(0,r),t.slice(r+e.length)]},d=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),a=0;a<n.length;a++){var o=n[a],s=t[o];(i?-1!==e.indexOf(o):e(o,s,t))&&(r[o]=s)}return r},h=r(function(t,e){function r(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function n(t,e){return e.encode?e.strict?encodeURIComponent(t).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`):encodeURIComponent(t):t}function i(t,e){return e.decode?l(t):t}function a(t){return Array.isArray(t)?t.sort():"object"==typeof t?a(Object.keys(t)).sort((t,e)=>Number(t)-Number(e)).map(e=>t[e]):t}function o(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function s(t){const e=(t=o(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function u(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function c(t,e){r((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,r,n)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===n[t]&&(n[t]={}),n[t][e[1]]=r):n[t]=r};case"bracket":return(t,r,n)=>{e=/(\[\])$/.exec(t),n[t=t.replace(/\[\]$/,"")]=e?void 0!==n[t]?[].concat(n[t],r):[r]:r};case"comma":case"separator":return(e,r,n)=>{const a="string"==typeof r&&r.includes(t.arrayFormatSeparator),o="string"==typeof r&&!a&&i(r,t).includes(t.arrayFormatSeparator);r=o?i(r,t):r;const s=a||o?r.split(t.arrayFormatSeparator).map(e=>i(e,t)):null===r?r:i(r,t);n[e]=s};default:return(t,e,r)=>{r[t]=void 0!==r[t]?[].concat(r[t],e):e}}}(e),o=Object.create(null);if("string"!=typeof t)return o;if(!(t=t.trim().replace(/^[?#&]/,"")))return o;for(const r of t.split("&")){if(""===r)continue;let[t,a]=f(e.decode?r.replace(/\+/g," "):r,"=");a=void 0===a?null:["comma","separator"].includes(e.arrayFormat)?a:i(a,e),n(i(t,e),a,o)}for(const t of Object.keys(o)){const r=o[t];if("object"==typeof r&&null!==r)for(const t of Object.keys(r))r[t]=u(r[t],e);else o[t]=u(r,e)}return!1===e.sort?o:(!0===e.sort?Object.keys(o).sort():Object.keys(o).sort(e.sort)).reduce((t,e)=>{const r=o[e];return t[e]=Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?a(r):r,t},Object.create(null))}e.extract=s,e.parse=c,e.stringify=(t,e)=>{if(!t)return"";r((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);const i=r=>e.skipNull&&null==t[r]||e.skipEmptyString&&""===t[r],a=function(t){switch(t.arrayFormat){case"index":return e=>(r,i)=>{const a=r.length;return void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,[n(e,t),"[",a,"]"].join("")]:[...r,[n(e,t),"[",n(a,t),"]=",n(i,t)].join("")]};case"bracket":return e=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,[n(e,t),"[]"].join("")]:[...r,[n(e,t),"[]=",n(i,t)].join("")];case"comma":case"separator":return e=>(r,i)=>null==i||0===i.length?r:0===r.length?[[n(e,t),"=",n(i,t)].join("")]:[[r,n(i,t)].join(t.arrayFormatSeparator)];default:return e=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,n(e,t)]:[...r,[n(e,t),"=",n(i,t)].join("")]}}(e),o={};for(const e of Object.keys(t))i(e)||(o[e]=t[e]);const s=Object.keys(o);return!1!==e.sort&&s.sort(e.sort),s.map(r=>{const i=t[r];return void 0===i?"":null===i?n(r,e):Array.isArray(i)?i.reduce(a(r),[]).join("&"):n(r,e)+"="+n(i,e)}).filter(t=>t.length>0).join("&")},e.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);const[r,n]=f(t,"#");return Object.assign({url:r.split("?")[0]||"",query:c(s(t),e)},e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:i(n,e)}:{})},e.stringifyUrl=(t,r)=>{r=Object.assign({encode:!0,strict:!0},r);const i=o(t.url).split("?")[0]||"",a=e.extract(t.url),s=e.parse(a,{sort:!1}),u=Object.assign(s,t.query);let c=e.stringify(u,r);c&&(c=`?${c}`);let l=function(t){let e="";const r=t.indexOf("#");return-1!==r&&(e=t.slice(r)),e}(t.url);return t.fragmentIdentifier&&(l=`#${n(t.fragmentIdentifier,r)}`),`${i}${c}${l}`},e.pick=(t,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0},n);const{url:i,query:a,fragmentIdentifier:o}=e.parseUrl(t,n);return e.stringifyUrl({url:i,query:d(a,r),fragmentIdentifier:o},n)},e.exclude=(t,r,n)=>{const i=Array.isArray(r)?t=>!r.includes(t):(t,e)=>!r(t,e);return e.pick(t,i,n)}}),p={dateTimeLocal:"YYYY-MM-DD[T]HH:mm:ss",dateTimeUTC:"YYYYMMDD[T]HHmmss[Z]",allDay:"YYYYMMDD"};function y(t,e){var r=t.endTime,n=p[e];return{start:t.startTime.format(n),end:r.format(n)}}n.extend(i);var m=function(t,r){void 0===r&&(r=!0);var i=t.start,a=t.end,o=t.duration,s=function(t,e){if(null==t)return{};var r,n,i={},a=Object.keys(t);for(n=0;n<a.length;n++)e.indexOf(r=a[n])>=0||(i[r]=t[r]);return i}(t,["start","end","duration"]),u=r?n(i).utc():n(i),c=a?r?n(a).utc():n(a):function(){if(t.allDay)return u.add(1,"day");if(o&&2==o.length){var e=Number(o[0]);return u.add(e,o[1])}return r?n().utc():n()}();return e({},s,{startTime:u,endTime:c})};t.eventify=m,t.google=function(t){var e=m(t),r=y(e,e.allDay?"allDay":"dateTimeUTC"),n={action:"TEMPLATE",text:e.title,details:e.description,location:e.location,trp:e.busy,dates:r.start+"/"+r.end,recur:e.rRule?"RRULE:"+e.rRule:void 0};return e.guests&&e.guests.length&&(n.add=e.guests.join()),"https://calendar.google.com/calendar/render?"+h.stringify(n)},t.ics=function(t){var e=m(t),r=(e.description||"").replace(/,/gm,",").replace(/;/gm,";").replace(/\r\n/gm,"\n").replace(/\n/gm,"\\n").replace(/(\\n)[\s\t]+/gm,"\\n"),n=(e.location||"").replace(/,/gm,",").replace(/;/gm,";").replace(/\r\n/gm,"\n").replace(/\n/gm,"\\n").replace(/(\\n)[\s\t]+/gm,"\\n"),i=y(e,e.allDay?"allDay":"dateTimeUTC"),a="";return[{key:"BEGIN",value:"VCALENDAR"},{key:"VERSION",value:"2.0"},{key:"BEGIN",value:"VEVENT"},{key:"URL",value:e.url},{key:"DTSTART",value:i.start},{key:"DTEND",value:i.end},{key:"RRULE",value:e.rRule},{key:"SUMMARY",value:e.title},{key:"DESCRIPTION",value:r},{key:"LOCATION",value:n},{key:"ORGANIZER",value:e.organizer},{key:"END",value:"VEVENT"},{key:"END",value:"VCALENDAR"}].forEach(function(t){if(t.value)if("ORGANIZER"==t.key){var e=t.value;a+=t.key+";"+encodeURIComponent("CN="+e.name+":MAILTO:"+e.email+"\n")}else a+=t.key+":"+encodeURIComponent(t.value+"\n")}),"data:text/calendar;charset=utf8,"+a},t.office365=function(t){var e=m(t,!1),r=y(e,"dateTimeLocal");return"https://outlook.office.com/calendar/0/deeplink/compose?"+h.stringify({path:"/calendar/action/compose",rru:"addevent",startdt:r.start,enddt:r.end,subject:e.title,body:e.description,location:e.location,allday:e.allDay||!1})},t.outlook=function(t){var e=m(t,!1),r=y(e,"dateTimeLocal");return"https://outlook.live.com/calendar/0/deeplink/compose?"+h.stringify({path:"/calendar/action/compose",rru:"addevent",startdt:r.start,enddt:r.end,subject:e.title,body:e.description,location:e.location,allday:e.allDay||!1})},t.yahoo=function(t){var e=m(t),r=y(e,e.allDay?"allDay":"dateTimeUTC");return"https://calendar.yahoo.com/?"+h.stringify({v:60,title:e.title,st:r.start,et:r.end,desc:e.description,in_loc:e.location,dur:!!e.allDay&&"allday"})}});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t||self).calendarLink={})}(this,function(t){function e(){return e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},e.apply(this,arguments)}function r(t){var e={exports:{}};return t(e,e.exports),e.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var n=r(function(t,e){t.exports=function(){var t="millisecond",e="second",r="minute",n="hour",i="day",a="week",o="month",s="quarter",u="year",c="date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},h=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},p={s:h,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),i=r%60;return(e<=0?"+":"-")+h(n,2,"0")+":"+h(i,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),i=e.clone().add(n,o),a=r-i<0,s=e.clone().add(n+(a?-1:1),o);return+(-(n+(r-i)/(a?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(l){return{M:o,y:u,w:a,d:i,D:c,h:n,m:r,s:e,ms:t,Q:s}[l]||String(l||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",m={};m[y]=d;var g=function(t){return t instanceof O},$=function(t,e,r){var n;if(!t)return y;if("string"==typeof t)m[t]&&(n=t),e&&(m[t]=e,n=t);else{var i=t.name;m[i]=t,n=i}return!r&&n&&(y=n),n||!r&&y},v=function(t,e){if(g(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new O(r)},D=p;D.l=$,D.i=g,D.w=function(t,e){return v(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var O=function(){function d(t){this.$L=$(t.locale,null,!0),this.parse(t)}var h=d.prototype;return h.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(D.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(l);if(n){var i=n[2]-1||0,a=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},h.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},h.$utils=function(){return D},h.isValid=function(){return!("Invalid Date"===this.$d.toString())},h.isSame=function(t,e){var r=v(t);return this.startOf(e)<=r&&r<=this.endOf(e)},h.isAfter=function(t,e){return v(t)<this.startOf(e)},h.isBefore=function(t,e){return this.endOf(e)<v(t)},h.$g=function(t,e,r){return D.u(t)?this[e]:this.set(r,t)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(t,s){var l=this,f=!!D.u(s)||s,d=D.p(t),h=function(t,e){var r=D.w(l.$u?Date.UTC(l.$y,e,t):new Date(l.$y,e,t),l);return f?r:r.endOf(i)},p=function(t,e){return D.w(l.toDate()[t].apply(l.toDate("s"),(f?[0,0,0,0]:[23,59,59,999]).slice(e)),l)},y=this.$W,m=this.$M,g=this.$D,$="set"+(this.$u?"UTC":"");switch(d){case u:return f?h(1,0):h(31,11);case o:return f?h(1,m):h(0,m+1);case a:var v=this.$locale().weekStart||0,O=(y<v?y+7:y)-v;return h(f?g-O:g+(6-O),m);case i:case c:return p($+"Hours",0);case n:return p($+"Minutes",1);case r:return p($+"Seconds",2);case e:return p($+"Milliseconds",3);default:return this.clone()}},h.endOf=function(t){return this.startOf(t,!1)},h.$set=function(a,s){var l,f=D.p(a),d="set"+(this.$u?"UTC":""),h=(l={},l[i]=d+"Date",l[c]=d+"Date",l[o]=d+"Month",l[u]=d+"FullYear",l[n]=d+"Hours",l[r]=d+"Minutes",l[e]=d+"Seconds",l[t]=d+"Milliseconds",l)[f],p=f===i?this.$D+(s-this.$W):s;if(f===o||f===u){var y=this.clone().set(c,1);y.$d[h](p),y.init(),this.$d=y.set(c,Math.min(this.$D,y.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},h.set=function(t,e){return this.clone().$set(t,e)},h.get=function(t){return this[D.p(t)]()},h.add=function(t,s){var c,l=this;t=Number(t);var f=D.p(s),d=function(e){var r=v(l);return D.w(r.date(r.date()+Math.round(e*t)),l)};if(f===o)return this.set(o,this.$M+t);if(f===u)return this.set(u,this.$y+t);if(f===i)return d(1);if(f===a)return d(7);var h=(c={},c[r]=6e4,c[n]=36e5,c[e]=1e3,c)[f]||1,p=this.$d.getTime()+t*h;return D.w(p,this)},h.subtract=function(t,e){return this.add(-1*t,e)},h.format=function(t){var e=this;if(!this.isValid())return"Invalid Date";var r=t||"YYYY-MM-DDTHH:mm:ssZ",n=D.z(this),i=this.$locale(),a=this.$H,o=this.$m,s=this.$M,u=i.weekdays,c=i.months,l=function(t,n,i,a){return t&&(t[n]||t(e,r))||i[n].substr(0,a)},d=function(t){return D.s(a%12||12,t,"0")},h=i.meridiem||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n},p={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:D.s(s+1,2,"0"),MMM:l(i.monthsShort,s,c,3),MMMM:l(c,s),D:this.$D,DD:D.s(this.$D,2,"0"),d:String(this.$W),dd:l(i.weekdaysMin,this.$W,u,2),ddd:l(i.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(a),HH:D.s(a,2,"0"),h:d(1),hh:d(2),a:h(a,o,!0),A:h(a,o,!1),m:String(o),mm:D.s(o,2,"0"),s:String(this.$s),ss:D.s(this.$s,2,"0"),SSS:D.s(this.$ms,3,"0"),Z:n};return r.replace(f,function(t,e){return e||p[t]||n.replace(":","")})},h.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},h.diff=function(t,c,l){var f,d=D.p(c),h=v(t),p=6e4*(h.utcOffset()-this.utcOffset()),y=this-h,m=D.m(this,h);return m=(f={},f[u]=m/12,f[o]=m,f[s]=m/3,f[a]=(y-p)/6048e5,f[i]=(y-p)/864e5,f[n]=y/36e5,f[r]=y/6e4,f[e]=y/1e3,f)[d]||y,l?m:D.a(m)},h.daysInMonth=function(){return this.endOf(o).$D},h.$locale=function(){return m[this.$L]},h.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=$(t,e,!0);return n&&(r.$L=n),r},h.clone=function(){return D.w(this.$d,this)},h.toDate=function(){return new Date(this.valueOf())},h.toJSON=function(){return this.isValid()?this.toISOString():null},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},d}(),b=O.prototype;return v.prototype=b,[["$ms",t],["$s",e],["$m",r],["$H",n],["$W",i],["$M",o],["$y",u],["$D",c]].forEach(function(t){b[t[1]]=function(e){return this.$g(e,t[0],t[1])}}),v.extend=function(t,e){return t.$i||(t(e,O,v),t.$i=!0),v},v.locale=$,v.isDayjs=g,v.unix=function(t){return v(1e3*t)},v.en=m[y],v.Ls=m,v.p={},v}()}),i=r(function(t,e){t.exports=function(t,e,r){var n=e.prototype;r.utc=function(t){return new e({date:t,utc:!0,args:arguments})},n.utc=function(t){var e=r(this.toDate(),{locale:this.$L,utc:!0});return t?e.add(this.utcOffset(),"minute"):e},n.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var i=n.parse;n.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),i.call(this,t)};var a=n.init;n.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else a.call(this)};var o=n.utcOffset;n.utcOffset=function(t,e){var r=this.$utils().u;if(r(t))return this.$u?0:r(this.$offset)?o.call(this):this.$offset;var n=Math.abs(t)<=16?60*t:t,i=this;if(e)return i.$offset=n,i.$u=0===t,i;if(0!==t){var a=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(i=this.local().add(n+a,"minute")).$offset=n,i.$x.$localOffset=a}else i=this.utc();return i};var s=n.format;n.format=function(t){return s.call(this,t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":""))},n.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||(new Date).getTimezoneOffset());return this.$d.valueOf()-6e4*t},n.isUTC=function(){return!!this.$u},n.toISOString=function(){return this.toDate().toISOString()},n.toString=function(){return this.toDate().toUTCString()};var u=n.toDate;n.toDate=function(t){return"s"===t&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():u.call(this)};var c=n.diff;n.diff=function(t,e,n){if(t&&this.$u===t.$u)return c.call(this,t,e,n);var i=this.local(),a=r(t).local();return c.call(i,a,e,n)}}}),a="%[a-f0-9]{2}",o=new RegExp(a,"gi"),s=new RegExp("("+a+")+","gi");function u(t,e){try{return decodeURIComponent(t.join(""))}catch(t){}if(1===t.length)return t;var r=t.slice(0,e=e||1),n=t.slice(e);return Array.prototype.concat.call([],u(r),u(n))}function c(t){try{return decodeURIComponent(t)}catch(n){for(var e=t.match(o),r=1;r<e.length;r++)e=(t=u(e,r).join("")).match(o);return t}}var l=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return function(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},r=s.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch(t){var n=c(r[0]);n!==r[0]&&(e[r[0]]=n)}r=s.exec(t)}e["%C2"]="�";for(var i=Object.keys(e),a=0;a<i.length;a++){var o=i[a];t=t.replace(new RegExp(o,"g"),e[o])}return t}(t)}},f=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];const r=t.indexOf(e);return-1===r?[t]:[t.slice(0,r),t.slice(r+e.length)]},d=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),a=0;a<n.length;a++){var o=n[a],s=t[o];(i?-1!==e.indexOf(o):e(o,s,t))&&(r[o]=s)}return r},h=r(function(t,e){function r(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function n(t,e){return e.encode?e.strict?encodeURIComponent(t).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`):encodeURIComponent(t):t}function i(t,e){return e.decode?l(t):t}function a(t){return Array.isArray(t)?t.sort():"object"==typeof t?a(Object.keys(t)).sort((t,e)=>Number(t)-Number(e)).map(e=>t[e]):t}function o(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function s(t){const e=(t=o(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function u(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function c(t,e){r((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);const n=function(t){let e;switch(t.arrayFormat){case"index":return(t,r,n)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===n[t]&&(n[t]={}),n[t][e[1]]=r):n[t]=r};case"bracket":return(t,r,n)=>{e=/(\[\])$/.exec(t),n[t=t.replace(/\[\]$/,"")]=e?void 0!==n[t]?[].concat(n[t],r):[r]:r};case"comma":case"separator":return(e,r,n)=>{const a="string"==typeof r&&r.includes(t.arrayFormatSeparator),o="string"==typeof r&&!a&&i(r,t).includes(t.arrayFormatSeparator);r=o?i(r,t):r;const s=a||o?r.split(t.arrayFormatSeparator).map(e=>i(e,t)):null===r?r:i(r,t);n[e]=s};default:return(t,e,r)=>{r[t]=void 0!==r[t]?[].concat(r[t],e):e}}}(e),o=Object.create(null);if("string"!=typeof t)return o;if(!(t=t.trim().replace(/^[?#&]/,"")))return o;for(const r of t.split("&")){if(""===r)continue;let[t,a]=f(e.decode?r.replace(/\+/g," "):r,"=");a=void 0===a?null:["comma","separator"].includes(e.arrayFormat)?a:i(a,e),n(i(t,e),a,o)}for(const t of Object.keys(o)){const r=o[t];if("object"==typeof r&&null!==r)for(const t of Object.keys(r))r[t]=u(r[t],e);else o[t]=u(r,e)}return!1===e.sort?o:(!0===e.sort?Object.keys(o).sort():Object.keys(o).sort(e.sort)).reduce((t,e)=>{const r=o[e];return t[e]=Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?a(r):r,t},Object.create(null))}e.extract=s,e.parse=c,e.stringify=(t,e)=>{if(!t)return"";r((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);const i=r=>e.skipNull&&null==t[r]||e.skipEmptyString&&""===t[r],a=function(t){switch(t.arrayFormat){case"index":return e=>(r,i)=>{const a=r.length;return void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,[n(e,t),"[",a,"]"].join("")]:[...r,[n(e,t),"[",n(a,t),"]=",n(i,t)].join("")]};case"bracket":return e=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,[n(e,t),"[]"].join("")]:[...r,[n(e,t),"[]=",n(i,t)].join("")];case"comma":case"separator":return e=>(r,i)=>null==i||0===i.length?r:0===r.length?[[n(e,t),"=",n(i,t)].join("")]:[[r,n(i,t)].join(t.arrayFormatSeparator)];default:return e=>(r,i)=>void 0===i||t.skipNull&&null===i||t.skipEmptyString&&""===i?r:null===i?[...r,n(e,t)]:[...r,[n(e,t),"=",n(i,t)].join("")]}}(e),o={};for(const e of Object.keys(t))i(e)||(o[e]=t[e]);const s=Object.keys(o);return!1!==e.sort&&s.sort(e.sort),s.map(r=>{const i=t[r];return void 0===i?"":null===i?n(r,e):Array.isArray(i)?i.reduce(a(r),[]).join("&"):n(r,e)+"="+n(i,e)}).filter(t=>t.length>0).join("&")},e.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);const[r,n]=f(t,"#");return Object.assign({url:r.split("?")[0]||"",query:c(s(t),e)},e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:i(n,e)}:{})},e.stringifyUrl=(t,r)=>{r=Object.assign({encode:!0,strict:!0},r);const i=o(t.url).split("?")[0]||"",a=e.extract(t.url),s=e.parse(a,{sort:!1}),u=Object.assign(s,t.query);let c=e.stringify(u,r);c&&(c=`?${c}`);let l=function(t){let e="";const r=t.indexOf("#");return-1!==r&&(e=t.slice(r)),e}(t.url);return t.fragmentIdentifier&&(l=`#${n(t.fragmentIdentifier,r)}`),`${i}${c}${l}`},e.pick=(t,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0},n);const{url:i,query:a,fragmentIdentifier:o}=e.parseUrl(t,n);return e.stringifyUrl({url:i,query:d(a,r),fragmentIdentifier:o},n)},e.exclude=(t,r,n)=>{const i=Array.isArray(r)?t=>!r.includes(t):(t,e)=>!r(t,e);return e.pick(t,i,n)}}),p={dateTimeLocal:"YYYY-MM-DD[T]HH:mm:ss",dateTimeUTC:"YYYYMMDD[T]HHmmss[Z]",allDay:"YYYYMMDD"};function y(t,e){var r=t.endTime,n=p[e];return{start:t.startTime.format(n),end:r.format(n)}}n.extend(i);var m=function(t,r){void 0===r&&(r=!0);var i=t.start,a=t.end,o=t.duration,s=function(t,e){if(null==t)return{};var r,n,i={},a=Object.keys(t);for(n=0;n<a.length;n++)e.indexOf(r=a[n])>=0||(i[r]=t[r]);return i}(t,["start","end","duration"]),u=r?n(i).utc():n(i),c=a?r?n(a).utc():n(a):function(){if(t.allDay)return u.add(1,"day");if(o&&2==o.length){var e=Number(o[0]);return u.add(e,o[1])}return r?n().utc():n()}();return e({},s,{startTime:u,endTime:c})};t.aol=function(t){var e=m(t),r=y(e,e.allDay?"allDay":"dateTimeUTC");return"https://calendar.aol.com/?"+h.stringify({v:60,title:e.title,st:r.start,et:r.end,desc:e.description,in_loc:e.location,dur:!!e.allDay&&"allday"})},t.eventify=m,t.google=function(t){var e=m(t),r=y(e,e.allDay?"allDay":"dateTimeUTC"),n={action:"TEMPLATE",text:e.title,details:e.description,location:e.location,trp:e.busy,dates:r.start+"/"+r.end,recur:e.rRule?"RRULE:"+e.rRule:void 0};return e.guests&&e.guests.length&&(n.add=e.guests.join()),"https://calendar.google.com/calendar/render?"+h.stringify(n)},t.ics=function(t){var e=m(t),r=(e.description||"").replace(/,/gm,",").replace(/;/gm,";").replace(/\r\n/gm,"\n").replace(/\n/gm,"\\n").replace(/(\\n)[\s\t]+/gm,"\\n"),n=(e.location||"").replace(/,/gm,",").replace(/;/gm,";").replace(/\r\n/gm,"\n").replace(/\n/gm,"\\n").replace(/(\\n)[\s\t]+/gm,"\\n"),i=y(e,e.allDay?"allDay":"dateTimeUTC"),a="";return[{key:"BEGIN",value:"VCALENDAR"},{key:"VERSION",value:"2.0"},{key:"BEGIN",value:"VEVENT"},{key:"URL",value:e.url},{key:"DTSTART",value:i.start},{key:"DTEND",value:i.end},{key:"RRULE",value:e.rRule},{key:"SUMMARY",value:e.title},{key:"DESCRIPTION",value:r},{key:"LOCATION",value:n},{key:"ORGANIZER",value:e.organizer},{key:"END",value:"VEVENT"},{key:"END",value:"VCALENDAR"}].forEach(function(t){if(t.value)if("ORGANIZER"==t.key){var e=t.value;a+=t.key+";"+encodeURIComponent("CN="+e.name+":MAILTO:"+e.email+"\n")}else a+=t.key+":"+encodeURIComponent(t.value+"\n")}),"data:text/calendar;charset=utf8,"+a},t.office365=function(t){var e=m(t,!1),r=y(e,"dateTimeLocal");return"https://outlook.office.com/calendar/0/action/compose?"+h.stringify({path:"/calendar/action/compose",rru:"addevent",startdt:r.start,enddt:r.end,subject:e.title,body:e.description,location:e.location,allday:e.allDay||!1})},t.office365Mobile=function(t){var e=m(t,!1),r=y(e,"dateTimeLocal");return"https://outlook.office.com/calendar/0/deeplink/compose?"+h.stringify({path:"/calendar/action/compose",rru:"addevent",startdt:r.start,enddt:r.end,subject:e.title,body:e.description,location:e.location,allday:e.allDay||!1})},t.outlook=function(t){var e=m(t,!1),r=y(e,"dateTimeLocal");return"https://outlook.live.com/calendar/0/action/compose?"+h.stringify({path:"/calendar/action/compose",rru:"addevent",startdt:r.start,enddt:r.end,subject:e.title,body:e.description,location:e.location,allday:e.allDay||!1})},t.outlookMobile=function(t){var e=m(t,!1),r=y(e,"dateTimeLocal");return"https://outlook.live.com/calendar/0/deeplink/compose?"+h.stringify({path:"/calendar/action/compose",rru:"addevent",startdt:r.start,enddt:r.end,subject:e.title,body:e.description,location:e.location,allday:e.allDay||!1})},t.yahoo=function(t){var e=m(t),r=y(e,e.allDay?"allDay":"dateTimeUTC");return"https://calendar.yahoo.com/?"+h.stringify({v:60,title:e.title,st:r.start,et:r.end,desc:e.description,in_loc:e.location,dur:!!e.allDay&&"allday"})}});
//# sourceMappingURL=index.umd.js.map

@@ -54,2 +54,10 @@ import * as dayjs from "dayjs";

}
export { CalendarEvent, CalendarEventOrganizer, NormalizedCalendarEvent, Outlook, Yahoo, Google };
interface Aol extends Record<string, string | boolean | number | undefined> {
v: number;
title: string;
st: string;
et: string;
desc?: string;
in_loc?: string;
}
export { CalendarEvent, CalendarEventOrganizer, NormalizedCalendarEvent, Outlook, Yahoo, Google, Aol };
{
"name": "calendar-link",
"version": "2.4.0",
"version": "2.5.0",
"description": "📅 Calendar link generator for popular services, like Google, Outlook, and Yahoo.",

@@ -9,3 +9,3 @@ "main": "dist/index.js",

"exports": {
"import": "./dist/index.modern.js",
"import": "./dist/index.modern.mjs",
"require": "./dist/index.js"

@@ -54,3 +54,3 @@ },

"jest": "^26.6.0",
"microbundle": "^0.13.0",
"microbundle": "^0.15.1",
"npm-run-all": "^4.1.5",

@@ -57,0 +57,0 @@ "semantic-release": "^17.2.1",

@@ -62,4 +62,5 @@ # 📅 Calendar Link

- The `url` field defaults to `document.URL` if a global `document` object exists. For server-side rendering, you should supply the `url` manually.
Not all calendars support the `guests` and `url` fields.
Not all calendars support the `guests` and `url` fields.
- If you don't pass the start and end time in UTC, Google will convert it to UTC but Outlook won't, so it's a good idea to use UTC when passing dates and times
- There are some known issues in Office 365 because of which we can't generate a consistent link in all devices (#542)

@@ -66,0 +67,0 @@ ## License

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc