File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script setup lang="ts">
22import { computed } from ' vue'
3- import { toCompactISOTimeFromISO } from ' ../../fixtures'
3+ import { toCompactISOTimeFromISO } from ' ../../fixtures'
44
55const props = defineProps <{
66 redirectToUrl: (calendarLink : string | undefined ) => void
@@ -19,10 +19,10 @@ const compactExpiryTime = computed(() => {
1919})
2020
2121const timeZone = new Intl .DateTimeFormat (' en-US' , {
22- timeZoneName: ' short' ,
23- }).resolvedOptions ().timeZone
22+ timeZoneName: ' short' ,
23+ }).resolvedOptions ().timeZone
2424
25- console .log (" starttime" , props .startTime )
25+ console .log (' starttime' , props .startTime )
2626const calendarLink = computed (() => {
2727 return ` https://calendar.google.com/calendar/r/eventedit?action=TEMPLATE&dates=${compactStartTime .value }%2F${compactExpiryTime .value }&text=${encodeURIComponent (props .description ? props .description : ' ' )}&details=${encodeURIComponent (props .description ? props .description : ' ' )}&location=${encodeURIComponent (props .meetingLink ? props .meetingLink : ' ' )}&stz=${timeZone }&etz=${timeZone } `
2828})
@@ -36,6 +36,6 @@ const calendarLink = computed(() => {
3636 }
3737 "
3838 >
39- Add to Calendar 🗓️
39+ Add to Calendar 🗓️
4040 </button >
4141</template >
Original file line number Diff line number Diff line change @@ -31,16 +31,16 @@ export const formatISOTimestamp = (isoTimestamp: string) => {
3131
3232export const toCompactISOTimeFromISO = ( isoTimestamp : string ) => {
3333 const date = new Date ( isoTimestamp )
34- const pad = ( number : number ) => number . toString ( ) . padStart ( 2 , '0' ) ;
34+ const pad = ( number : number ) => number . toString ( ) . padStart ( 2 , '0' )
3535
3636 // Extract components
3737 const year = date . getUTCFullYear ( )
38- const month = pad ( date . getUTCMonth ( ) + 1 ) ; // Months are zero-indexed
39- const day = pad ( date . getUTCDate ( ) ) ;
38+ const month = pad ( date . getUTCMonth ( ) + 1 ) // Months are zero-indexed
39+ const day = pad ( date . getUTCDate ( ) )
4040 const hours = pad ( date . getUTCHours ( ) )
4141 const minutes = pad ( date . getUTCMinutes ( ) )
4242 const seconds = pad ( date . getUTCSeconds ( ) )
43-
43+
4444 return `${ year } ${ month } ${ day } T${ hours } ${ minutes } ${ seconds } Z`
4545}
4646
You can’t perform that action at this time.
0 commit comments