Generate .ics calendar files with household waste pickup schedules — easily importable into calendar apps like Google Calendar, Apple Calendar, or Outlook.
- 📅 Generates .ics files per street and per area
- 🏘 Supports multiple streets per area with individual pickup days
- 📆 Uses ISO week numbers with proper weekday offset support
- 🕒 Adds custom pickup notes (e.g. "Låt sopkärlet stå tills det blir tömt.")
- 🧾 Custom calendar names using
X-WR-CALNAME(shown in some apps) - 🔧 Easily extendable by editing JSON files — no code changes needed
├── generate.js # Main script to generate .ics files
├── area_file_processor.js # Processes area JSON files and prepares data for calendar generation
├── calendar_generator.js # Handles the creation of ICS files and stable DTSTAMP generation
├── utils.js # Utility functions for file handling, date formatting, and more
├── areas/
│ ├── area_29.json # JSON file defining pickup schedule, types, and streets
├── calendars/ # Output folder for generated .ics files
│ ├── area_29/
│ │ ├── area_29_bergelesgatan.ics
│ │ └── ...
├── package.json # Project dependencies and metadata
├── package-lock.json # Dependency lock file
└── README.md # Project documentation
- Node.js v18 or higher (v20+ recommended)
icsanddate-fnslibraries
Install dependencies:
npm installTo generate calendar files:
node generateAll .ics files will be written to the calendars/ folder, organized per area.
This is the main entry point for generating .ics files. It orchestrates the following steps:
- Ensures the output folder (
calendars/) exists. - Reads all JSON files in the
areas/folder. - Processes each area file using
area_file_processor.js. - Generates
.icsfiles for each street in the area usingcalendar_generator.js. - Runs
update-readme-links.jsto update the README with links to the generated calendars.
Run this script with:
node generateThis module processes the JSON files in the areas/ folder. It performs the following tasks:
- Reads and validates the structure of the JSON files.
- Extracts relevant data such as area, streets, pickup days, and event types.
- Prepares the data for use by
calendar_generator.js.
This module ensures that the input data is clean and ready for calendar generation.
This module handles the creation of .ics files. It includes:
-
Event Generation:
- Converts the processed data into ICS-compatible events.
- Sets
DTSTAMPto the current runtime.
-
File Writing:
- Writes the generated
.icsfiles to the appropriate folder.
- Writes the generated
-
Custom Calendar Names:
- Adds
X-WR-CALNAMEto the ICS file for better display in calendar apps.
- Adds
This module ensures that the .ics files are correctly formatted and ready for use.
You can subscribe directly via GitHub Raw URLs.
When clicking on the calendar link it will open in a new browser tab.
Copy the url and import that to your calendar app.
Area 29
You can subscribe to the generated .ics files in most calendar apps:
Note:
X-WR-CALNAMEis ignored when using public URL subscriptions.
- In Google Calendar:
- Click the
+next to Other calendars - Select From URL
- Paste the
.icsfile URL
- Click the
- (Optional) Rename the calendar manually
- (Optional) Change the color of the calendar
- In Calendar app: File → New Calendar Subscription
- Paste the
.icsfile URL - Apple will show the name from
X-WR-CALNAME🎉
{
"area": 29,
"calendarTitle": "Sopkalender 2025",
"streetPickup": [
{
"street": "Bergelésgatan",
"pickupDay": "Tuesday"
},
{
"street": "Innövervägen",
"pickupDay": "Tuesday"
},
{
"street": "Tallhedsgatan",
"pickupDay": "Tuesday"
},
{
"street": "Porsnäsvägen",
"pickupDay": "Tuesday"
}
],
"types": [
{
"type": "M",
"description": "Matavfall",
"icon": "🟫"
},
{
"type": "R",
"description": "Restavfall",
"icon": "🟩"
}
],
"year": 2025,
"week": [
{
"weekNumber": 2,
"type": "M",
"pickupDayDiff": 0,
"description": "Trettondedag jul: Låt sopkärlet stå tills det blir tömt."
}
{
"weekNumber": 3,
"type": "R"
},
{
"weekNumber": 6,
"type": "M"
},
...
]
}You can add more areas and streets by creating new JSON files in the areas/ folder using the same structure.
MIT — free to use and adapt for your municipality or neighborhood.