Overview
Event QR codes encode calendar events in the iCalendar (vCalendar) format. When scanned, most smartphones automatically recognize the event format and offer to add it to the device’s calendar app. This is ideal for event invitations, meeting reminders, conference schedules, and appointment cards.Data Structure
Event QR codes use theEventQrData interface:
The event name or title. This is a required field.
Detailed description of the event. Optional but recommended for providing context.
The event venue or location. This is a required field.
Event start date and time in ISO 8601 format (e.g., “2024-03-15 14:30” or “2024-03-15T14:30:00”). Must be a valid date/time.
Event end date and time in ISO 8601 format. Must be a valid date/time and must be after the start time.
Encoding Format
The event encoder (from/src/domain/encoders/encoders.ts:76-97) creates an iCalendar (VCALENDAR) formatted string:
iCalendar Format Specification
The encoded event follows the VCALENDAR 2.0 structure:DateTime Formatting
The encoder converts standard datetime strings to iCalendar format:- Removes all dashes (
-) and colons (:) - Replaces space with
Tto separate date and time - Format:
YYYYMMDDTHHmmss
"2024-03-15 14:30"→"20240315T1430""2024-03-15T14:30:00"→"20240315T143000"
Example Encoding
Input:Validation Rules
The validator (from/src/domain/validation/validators.ts:170-210) enforces these requirements:
Required Fields
Required Fields
The following fields cannot be empty or whitespace only:
title- “El título es obligatorio”location- “La ubicación es obligatoria”start- “La fecha de inicio es obligatoria”end- “La fecha de fin es obligatoria”
Date/Time Format Validation
Date/Time Format Validation
Both
start and end must be valid dates:- Must be parseable by JavaScript’s
Date()constructor - If invalid, errors are returned:
- “Fecha de inicio inválida”
- “Fecha de fin inválida”
Logical Date Order
Logical Date Order
The end time must be after the start time:
endmust have a later timestamp thanstart- If
endis equal to or beforestart:- Error: “La fecha de fin debe ser posterior a la de inicio”
Validation Implementation
Usage Example
Common Use Cases
- Event Invitations: Add to invitations for conferences, parties, or gatherings
- Meeting Scheduling: Share meeting times in emails or Slack messages
- Conference Schedules: Provide session details at conferences
- Appointment Cards: Medical, dental, or service appointment reminders
- Webinar Registration: Share webinar date and link
- Workshop/Training: Distribute training session details
- Trade Shows: Share booth visit times and locations
Best Practices
- Title: Keep it concise but descriptive (e.g., “Q1 Planning Meeting” vs “Meeting”)
- Description: Include agenda items, requirements, or what to bring
- Location: Provide specific details (room number, floor, building name)
- Timing: Ensure dates are in the future and verify timezone considerations
- Duration: Allow adequate time between start and end
DateTime Input Formats
The validator accepts any format parseable by JavaScript’sDate() constructor:
"2024-03-15 14:30"- Space-separated date and time"2024-03-15T14:30:00"- ISO 8601 format"2024-03-15T14:30:00.000Z"- ISO 8601 with milliseconds and UTC"March 15, 2024 14:30"- Human-readable format
For best compatibility, use ISO 8601 format:
YYYY-MM-DD HH:mm or YYYY-MM-DDTHH:mm:ss