@@ -15,9 +15,6 @@ import { GetStaticProps } from 'next'
15
15
import axios from 'axios'
16
16
import ical from 'node-ical'
17
17
import moment from 'moment'
18
- // import dayjs from 'dayjs'
19
- // import localizedFormat from 'dayjs/plugin/localizedFormat'
20
- // import isBetween from 'dayjs/plugin/isBetween'
21
18
22
19
/* eslint-enable */
23
20
export const getStaticProps : GetStaticProps = async ( ) => {
@@ -68,8 +65,6 @@ export const getStaticProps: GetStaticProps = async () => {
68
65
}
69
66
// Function to filter and print events for the next 4 weeks from today
70
67
function printEventsForNextFourWeeks ( icalData : { [ x : string ] : any } ) {
71
- // dayjs.extend(localizedFormat)
72
- // dayjs.extend(isBetween)
73
68
const arrayDates = [ ]
74
69
if ( ! icalData ) {
75
70
console . error ( 'iCal data is empty or invalid.' )
@@ -79,6 +74,8 @@ function printEventsForNextFourWeeks(icalData: { [x: string]: any }) {
79
74
// Calculate the range of dates for the next 4 weeks from today
80
75
const today = moment ( ) . startOf ( 'day' )
81
76
const nextFourWeeksEnd = moment ( ) . add ( 4 , 'weeks' ) . endOf ( 'day' )
77
+
78
+
82
79
83
80
// Loop through the events in the iCal data
84
81
for ( const k in icalData ) {
@@ -89,7 +86,7 @@ function printEventsForNextFourWeeks(icalData: { [x: string]: any }) {
89
86
90
87
// Get the timezone of the event
91
88
const timezone = event . tz || 'UTC' // Default to UTC if timezone information is not provided
92
-
89
+
93
90
// Complicated case - if an RRULE exists, handle multiple recurrences of the event.
94
91
if ( event . rrule !== undefined ) {
95
92
// For recurring events, get the set of event start dates that fall within the range
@@ -114,13 +111,23 @@ function printEventsForNextFourWeeks(icalData: { [x: string]: any }) {
114
111
}
115
112
}
116
113
}
114
+ else {
115
+ // Simple case - no recurrences, just print out the calendar event.
116
+ if ( startDate . isBetween ( today , nextFourWeeksEnd , undefined , '[]' ) ) {
117
+ const time = startDate . format ( 'MMMM Do YYYY, h:mm a' )
118
+ const day = startDate . format ( 'D' )
119
+ arrayDates . push ( { title, time, day, timezone } )
120
+ }
121
+ }
117
122
}
118
123
}
124
+
125
+ arrayDates . sort ( ( x , y ) => + new Date ( x . time ) - + new Date ( y . time ) )
126
+
119
127
return arrayDates
120
128
}
121
129
const Home = ( props : any ) => {
122
130
const blogPosts = props . blogPosts
123
- // console.log('anything', props.datesInfo)
124
131
const timeToRead = Math . ceil ( readingTime ( blogPosts [ 0 ] . content ) . minutes )
125
132
126
133
return (
@@ -148,16 +155,16 @@ const Home = (props: any) => {
148
155
</ div >
149
156
</ div >
150
157
151
- < div className = 'mb-16 md:mb-36 mx-auto w-2/3 md:w-5/6 lg:w-full' >
158
+ < div className = 'mb-16 md:mb-36 mx-auto w-full md:w-5/6 lg:w-full' >
152
159
< h3 className = 'text-white text-xl mb-4' > Used by</ h3 >
153
160
154
- < div className = 'grid md:grid-cols-2 lg:grid-cols-4 gap-6 mx-auto items-center w-1/2 md:w-100' >
161
+ < div className = 'grid md:grid-cols-2 lg:grid-cols-4 gap-6 mx-auto items-center w-1/3 md:w-100' >
155
162
< img src = '/img/logos/usedby/zapier-logo_white.png' className = 'w-40 mr-4' />
156
163
< img src = '/img/logos/usedby/microsoft-white.png' className = 'w-40 mr-4' />
157
164
< img src = '/img/logos/usedby/postman-white.png' className = 'w-40 mr-4' />
158
165
< img src = '/img/logos/usedby/github-white.png' className = 'w-40' />
159
166
</ div >
160
- < p className = 'text-white my-8' > More than 200 implementations generating over 100 million weekly downloads</ p >
167
+ < p className = 'text-white mx-4 my-8' > More than 200 implementations generating over 100 million weekly downloads</ p >
161
168
</ div >
162
169
</ div >
163
170
</ section >
@@ -211,16 +218,16 @@ const Home = (props: any) => {
211
218
< section className = 'lg:my-12 max-w-[1400px]' >
212
219
< div className = 'mb-12 md:w-3/4 mx-auto text-center' >
213
220
< h2 className = 'text-h3mobile md:text-h3 font-semibold mb-2' > Welcome to the JSON Schema Community</ h2 >
214
- < p className = 'mx-4 md:w-3/4 md:mx-auto lg:text-h5' > With over 60 million weekly installs, JSON Schema has a large and active developer community across the world. Join the Community to learn, share ideas, ask questions, develop JSON Schema tooling and build new connections.
221
+ < p className = 'mx-6 md:w-3/4 md:mx-auto lg:text-h5' > With over 60 million weekly installs, JSON Schema has a large and active developer community across the world. Join the Community to learn, share ideas, ask questions, develop JSON Schema tooling and build new connections.
215
222
</ p >
216
223
</ div >
217
- < div className = 'grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-12 mx-auto w-5/6' >
224
+ < div className = 'grid grid-cols-1 lg:grid-cols-3 gap-6 mb-12 mx-auto w-5/6 md:w-3/5 lg: w-5/6' >
218
225
< div className = 'w-full mb-6' >
219
226
< h3 className = 'mb-4 font-semibold' > Join the JSON Schema Community Slack!</ h3 >
220
227
< img src = '/img/home-page/slack-json-schema.png' className = 'w-full mb-4' />
221
228
{ /* <h3 className='mb-4 font-semibold' >Event</h3> */ }
222
229
< p className = 'mb-4' > Join our Slack to ask questions, get feedback on your projects, and connect with +5000 practitioners and experts.</ p >
223
- < button className = 'w-full lg:w-1/2 rounded border-2 bg-primary text-white h-[40px] ' > < a href = 'https://json-schema.org/ slack' > Join us</ a > </ button >
230
+ < button className = 'w-full lg:w-1/2 rounded border-2 bg-primary text-white h-[40px] ' > < a href = 'https://json-schema.slack.com/join/shared_invite/zt-1ywpdj4yd-bXiBLjYEbKWUjzon0qiY9Q#/shared-invite/email ' > Join us</ a > </ button >
224
231
</ div >
225
232
{ /* BlogPost Data */ }
226
233
< div className = 'w-full ' >
@@ -247,7 +254,7 @@ const Home = (props: any) => {
247
254
</ Link >
248
255
</ div >
249
256
</ div >
250
- < div className = ' ' >
257
+ < div >
251
258
< div className = 'md:w-full mb-6 mr-4' >
252
259
< h3 className = 'mb-2 font-semibold' > JSON Schema Community Meetings & Events </ h3 >
253
260
< p className = 'mb-4' > We hold monthly Office Hours and weekly Open Community Working Meetings. Office Hours are every first Tuesday of the month at 15:00 BST, and by appointment. Open Community Working Meetings are every Monday at 14:00 PT.
@@ -258,7 +265,7 @@ const Home = (props: any) => {
258
265
> Office Hours</ a > </ button >
259
266
</ div >
260
267
</ div >
261
- < div >
268
+ < div >
262
269
< div >
263
270
< Headline4 >
264
271
Upcoming events
@@ -273,7 +280,7 @@ const Home = (props: any) => {
273
280
</ p >
274
281
< div >
275
282
< p className = '' > { event . title } </ p >
276
- < p > { event . time } </ p >
283
+ < p > { event . time } { event . timezone } </ p >
277
284
</ div >
278
285
</ div >
279
286
</ li >
@@ -320,12 +327,11 @@ const Home = (props: any) => {
320
327
< section className = 'my-20' >
321
328
< div className = 'text-center mb-12' >
322
329
< h2 className = 'text-h3mobile md:text-h3 font-semibold mb-4' > Supported by</ h2 >
323
- < p className = 'w-1/2 mx-auto' > The following companies support us by letting us use their products.
< a href = 'mailto:[email protected] ' className = 'border-b border-black' > Email us
</ a > for more info.
</ p >
330
+ < p className = 'px-4 md: w-1/2 mx-auto' > The following companies support us by letting us use their products.
< br /> < a href = 'mailto:[email protected] ' className = 'border-b border-black' > Email us
</ a > for more info.
</ p >
324
331
</ div >
325
- < div className = 'grid grid-cols-2 md:gap-24 items-center mx-auto w-3/4 md:w-3/5 lg:w-1/2' >
326
- < a href = 'https://orbit.love/' className = 'w-44' > < img src = '/img/logos/supported/orbit-logo-color.png' /> </ a >
327
- < a href = 'https://json-schema.org/slack' className = 'w-44' > < img src = '/img/logos/supported/slack-logo.svg' /> </ a >
328
-
332
+ < div className = 'flex justify-center items-center' >
333
+ < a href = 'https://orbit.love/' > < img src = '/img/logos/supported/orbit-logo-color.png' className = 'w-44 mr-8' /> </ a >
334
+ < a href = 'https://json-schema.slack.com/join/shared_invite/zt-1ywpdj4yd-bXiBLjYEbKWUjzon0qiY9Q#/shared-invite/email' > < img src = '/img/logos/supported/slack-logo.svg' className = 'w-44 ml-8' /> </ a >
329
335
</ div >
330
336
</ section >
331
337
</ div >
@@ -334,4 +340,4 @@ const Home = (props: any) => {
334
340
}
335
341
336
342
export default Home
337
- Home . getLayout = getLayout
343
+ Home . getLayout = getLayout
0 commit comments