Skip to content

Commit

Permalink
fix date formats
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu committed Sep 20, 2023
1 parent 7cf06c5 commit 01c20f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ const events = defineCollection({
title: z.string(),
subtitle: z.string(),
type: z.enum(['bytesize', 'talk', 'hackathon', 'training']),
start_date: z.string(),
start_date: z.string().refine((s) => /^(\d{4}-\d{2}-\d{2})$/.test(s), {
message: 'start_date must be in the format YYYY-MM-DD',
}),
// check that it contains a time offset
start_time: z.string().refine((s) => /^(\d{2}:\d{2})([+-]\d{2}:\d{2})$/.test(s), {
message: 'start_time must be in the format HH:MM+|-HH:MM',
}),
end_date: z.string(),
end_date: z.string().refine((s) => /^(\d{4}-\d{2}-\d{2})$/.test(s), {
message: 'end_date must be in the format YYYY-MM-DD',
}),
end_time: z.string().refine((s) => /^(\d{2}:\d{2})([+-]\d{2}:\d{2})$/.test(s), {
message: 'end_time must be in the format HH:MM+|-HH:MM',
}),
Expand Down
4 changes: 2 additions & 2 deletions src/content/events/2023/training-basic-2023.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
title: Community Foundational Nextflow Training - September 2023
subtitle: The primary Nextflow / nf-core training for beginners, with 3 x 2.5 hour sessions.
type: training
start_date: '2023-09-6'
start_date: '2023-09-06'
start_time: '15:00+02:00'
end_date: '2023-09-8'
end_date: '2023-09-08'
end_time: '18:00+02:00'
location_name: YouTube
import_typeform: true
Expand Down

0 comments on commit 01c20f1

Please sign in to comment.