Real Builds / Contact tools

REAL BUILD · JAVASCRIPT

Build a Calendar Event Generator and Download an ICS File

Create a calendar event file for a consultation, workshop or customer handover. Enter the event details, review the generated iCalendar text and download an .ics file. The tool creates a file locally; it does not book a time slot or email invitations.

STACKHTML · CSS · JavaScriptDATAProcessed locally in your browser

Try the working demo

Use fictional data for testing. Generating a result does not send these fields to our server. Refreshing clears the fields.

Times use your browser time zone: . Check this before generating the event.

Build it and understand the decisions

Decide what the file represents

An event file gives the recipient details they can add to a calendar. It does not reserve your availability, check conflicts or collect an RSVP. Use it after agreeing a time, or make clear that the event is an informational reminder. This demo creates a single event without attendees or recurrence.

  • Include a useful title and location.
  • Put joining instructions in the description.
  • Keep sensitive information out of a file that may be forwarded.

Make the time zone explicit

The form displays the time zone reported by your browser. Start and end values are interpreted in that zone, then converted to UTC timestamps ending in Z. An importing calendar can display the same instant in the recipient’s own zone. Check your device time-zone setting before generating a file.

  • The end must be later than the start.
  • A nonexistent local time during a clock change is rejected.
  • Repeated local times during daylight-saving transitions remain ambiguous; use a time outside that interval.

Build a valid iCalendar document

The script creates one VCALENDAR containing one VEVENT. It assigns a unique UID, records a UTC creation timestamp and escapes text values so punctuation and newlines stay inside their fields. Long lines are folded by UTF-8 byte length. These details matter when titles or descriptions contain non-English characters.

  • Use CRLF line endings.
  • Escape backslashes, commas, semicolons and newlines in text.
  • Do not build extra calendar properties from untrusted raw lines.

Integrate with a confirmed booking

In a production workflow, generate calendar data from the confirmed server-side booking and keep a stable event identifier. Changes and cancellations need their own update policy. A downloaded file can be imported twice by some clients, so test the calendar apps your customers use and explain what happens when an appointment changes.

  • Confirm the imported start and end times.
  • Test a long location and a multiline description.
  • Keep booking records and notification retries on the server.

Full runnable source

Save the demo markup in a normal HTML document with a UTF-8 charset and viewport meta tag. Link the stylesheet in the head and load the script with defer. Keep the IDs unchanged and use one tool per page.

Copy the complete demo markup

Times use your browser time zone: . Check this before generating the event.

<link rel="stylesheet" href="business_tools.css">
<script src="contact_tools.js" defer></script>

Build your version with AI

Build a local calendar event generator with a title, browser-local start/end times, location and description. Export one RFC 5545 event using UTC dates, UID, DTSTAMP, text escaping, CRLF and UTF-8 line folding. Reject invalid times. Add preview and explicit download. Do not send invitations or claim to reserve availability.

Ask the assistant to explain every transformation and add checks with expected results. Review the output before replacing a working implementation.

Verify the result

Create a one-hour event, import it into your calendar and check both times. Try a title with accented characters, a description with commas and line breaks, an end before the start and a long field. Inspect the file to ensure user text cannot introduce a second event or new property.

In this repository, run node tests/contact_tools.test.cjs and python manage.py test main. Test keyboard access, narrow screens and errors in the browser as well.

Publish your version

A standalone version can be hosted as HTML, CSS and JavaScript over HTTPS. The generator needs no database or API secret. On this Django site, collect the static files and restart the configured application service after checking the release.

python manage.py check
python manage.py test main
python manage.py collectstatic --noinput

Open /en/tools/calendar-event-generator/ after deployment. Confirm that the script loads, the demo works and the page appears in the sitemap.

Limitations and production scope

Single events only: no all-day events, recurrence, attendees, email delivery, RSVP collection or availability checks. Times use the browser’s configured zone. Repeated times during daylight-saving changes are not disambiguated. Each generation makes a new UID, so repeated imports may create separate events. Keep the source booking separately.

Inputs are not persisted by this tool. Browser extensions or changes to your own deployment may affect data handling, so review the final implementation before using sensitive information.

Official reference

RFC 5545: iCalendar specification ↗

Build the next step

An event file belongs after an agreed time. Connect it to the enquiry, conversation and document steps around the appointment.

Understand the implementation

For a connected production workflow, agree the shared data fields, server validation and record identifiers before joining these steps.

Need calendar files generated from real bookings?

Describe your booking system, time zones and notification requirements. We can connect confirmed appointments to calendar files and a reliable customer communication workflow.

Describe the adaptation →