google-calendar-url
Version:
Generate shareable URLs for adding Google Calendar events
82 lines • 2.28 kB
TypeScript
export type GoogleCalendarEventUrlOptions = {
/**
* Start of event, acceptable formats are:
*
* 20200316T010000Z - UTC
* 2020-03-16T01:00:00Z - UTC
*
* 20200316T010000 - Time local to the user
* 2020-03-16T01:00:00 - Time local to the user
*
* 20200316 - All day event
* 2020-03-16 - All day event
*/
start: string;
/**
* End of event, acceptable formats are:
*
* 20200316T010000Z - UTC
* 2020-03-16T01:00:00Z - UTC
*
* 20200316T010000 - Time local to the user
* 2020-03-16T01:00:00 - Time local to the user
*
* 20200316 - All day event
* 2020-03-16 - All day event
*/
end: string;
/** Event title */
title?: string;
/** Event location */
location?: string;
/** Event details */
details?: string;
} | {
/**
* Start of event, acceptable formats are:
*
* 20200316T010000Z - UTC
* 2020-03-16T01:00:00Z - UTC
*
* 20200316T010000 - Time local to the user
* 2020-03-16T01:00:00 - Time local to the user
*
* 20200316 - All day event
* 2020-03-16 - All day event
*/
start?: never;
/**
* End of event, acceptable formats are:
*
* 20200316T010000Z - UTC
* 2020-03-16T01:00:00Z - UTC
*
* 20200316T010000 - Time local to the user
* 2020-03-16T01:00:00 - Time local to the user
*
* 20200316 - All day event
* 2020-03-16 - All day event
*/
end?: never;
/** Event title */
title?: string;
/** Event location */
location?: string;
/** Event details */
details?: string;
};
/**
* Generate a Google Calendar event URL
*/
export declare function googleCalendarEventUrl(options: GoogleCalendarEventUrlOptions): string;
export type DateSource = "local" | "utc";
export type DateStyle = "floating" | "instant" | "allDay";
export interface ToGoogleCalendarDateOptions {
/** Where to read the clock */
source: DateSource;
/** How Google Calendar should treat it */
style: DateStyle;
}
/** Convert a JS Date to a Google Calendar ready string */
export declare function toGoogleCalendarDate(date: Date, options: ToGoogleCalendarDateOptions): string;
//# sourceMappingURL=index.d.ts.map