Merge pull request #181 from emrysal/bugfix/ensure-utc-plugin-is-enabled

pull/147/head
Bailey Pumfleet 2021-05-10 18:00:32 +01:00 committed by GitHub
commit b760ed6ff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -4,8 +4,11 @@ import prisma from '../lib/prisma';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import { CheckIcon } from '@heroicons/react/outline'; import { CheckIcon } from '@heroicons/react/outline';
import { ClockIcon, CalendarIcon, LocationMarkerIcon } from '@heroicons/react/solid'; import { ClockIcon, CalendarIcon, LocationMarkerIcon } from '@heroicons/react/solid';
const dayjs = require('dayjs'); import dayjs from 'dayjs';
const ics = require('ics'); import utc from 'dayjs/plugin/utc';
import { createEvent } from 'ics';
dayjs.extend(utc);
export default function Success(props) { export default function Success(props) {
const router = useRouter(); const router = useRouter();
@ -22,7 +25,7 @@ export default function Success(props) {
optional['location'] = location; optional['location'] = location;
} }
const event = ics.createEvent({ const event = createEvent({
start, start,
startInputType: 'utc', startInputType: 'utc',
title: props.eventType.title + ' with ' + props.user.name, title: props.eventType.title + ' with ' + props.user.name,
@ -44,7 +47,6 @@ export default function Success(props) {
<title>Booking Confirmed | {props.eventType.title} with {props.user.name || props.user.username} | Calendso</title> <title>Booking Confirmed | {props.eventType.title} with {props.user.name || props.user.username} | Calendso</title>
<link rel="icon" href="/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
</Head> </Head>
<main className="max-w-3xl mx-auto my-24"> <main className="max-w-3xl mx-auto my-24">
<div className="fixed z-10 inset-0 overflow-y-auto"> <div className="fixed z-10 inset-0 overflow-y-auto">
<div className="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"> <div className="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">