A Node.js application to create and manage a personalized calendar TXT file by combining events from multiple sources including Israeli holidays, US holidays, birthdays, anniversaries, and recurring tasks.
Built in March 2021. This JavaScript application scrapes calendar data from online sources, processes previous year calendar files, validates and normalizes events, and generates a comprehensive daily calendar file with automated yearly task management, backups, and consistent formatting for yearly planning.
- 🗓️ Fetches Israeli calendar events and holidays from online sources
- 🇺🇸 Imports US holidays and events
- 📅 Manages birthdays, death anniversaries, and marriage anniversaries with age/year calculations
- ⏰ Tracks expiration dates for services, subscriptions, and documents
- ✅ Generates recurring tasks (daily, weekly, weekend patterns)
- 🔄 Processes previous year's calendar data to carry forward events
- 📊 Scans calendar files for unmarked tasks
- 💾 Creates automatic backups of the entire project
- Multi-source Event Collection: Combines Israeli holidays, US holidays, birthdays, anniversaries, expiration dates, and recurring tasks
- Age/Year Calculation: Automatically calculates ages for birthdays and years since for death anniversaries
- Previous Year Data Processing: Carries forward events from previous year's calendar
- Task Scanning: Validates and identifies unmarked tasks in calendar files
- Automatic Backups: Creates timestamped backups of the entire project
- Customizable Configuration: Flexible settings for year, paths, URLs, and limits
- Modular Architecture: Clean separation of concerns with services, models, utilities, and scripts
- Validation System: Comprehensive validation for URLs, file paths, and event data
- Backup Management: Automated backup creation with versioning
- File Operations: Enhanced file system operations using fs-extra
- Web Scraping: HTML parsing with jsdom for calendar data collection
- Rate Limiting: Polite crawling practices with delays between requests
- Clear Separation of Concerns: Organized into core, services, scripts, utils, and settings
- Configuration Management: Centralized settings in a single file
- Error Handling: Structured error handling with user-friendly messages
- Logging System: Detailed logging for debugging and monitoring
- Sandbox Testing: Test environment for experimental features
flowchart TB
subgraph Input["📥 Input Sources"]
A1[Previous Year Calendar<br/>event-dates-YYYY.txt]
A2[Israeli Calendar<br/>calendar.2net.co.il]
A3[US Holidays<br/>timeanddate.com]
end
subgraph Processing["⚙️ Processing Engine"]
B1[Create Logic]
B2[Event Service]
B3[Validation Service]
B4[Separator Service]
B1 --> B2
B1 --> B3
B2 --> B4
end
subgraph Services["🔧 Core Services"]
C1[Path Service<br/>File Management]
C2[Log Service<br/>Logging]
C3[Confirmation Service<br/>User Prompts]
C4[Application Service<br/>State Management]
end
subgraph Output["📤 Output"]
D1[New Calendar<br/>dist/event-dates-YYYY.txt]
D2[Backups<br/>Timestamped Copies]
D3[Logs<br/>Execution Reports]
end
A1 --> B2
A2 --> B2
A3 --> B2
B1 --> C1
B1 --> C2
B1 --> C3
B1 --> C4
B2 --> D1
C1 --> D2
C2 --> D3
style Input fill:#e1f5ff
style Processing fill:#fff4e1
style Services fill:#f0f0f0
style Output fill:#e8f5e9
- Node.js (v20.0.0 or higher)
- npm (comes with Node.js)
- Internet connection (for fetching online calendar data)
- Clone the repository:
git clone https://github.com/orassayag/event-dates-calendar.git
cd event-dates-calendar- Install dependencies:
npm installEdit the settings in src/settings/settings.js:
YEAR: The year to create the calendar for (e.g., 2025)SOURCE_PATH: Path to the previous year's source events fileCALENDAR_IL_LINK: Israeli calendar data source URLCALENDAR_US_LINK: US holidays data source URLDIST_FILE_NAME: Name for the output file (default: 'event-dates')OUTER_APPLICATION_PATH: Parent directory path for backups and sources
Creates a new calendar file for the target year:
npm startYou can also run other available scripts directly:
npm run scan # Scan for unmarked tasks
npm run backup # Create project backup
npm run sand # Run sandbox testsCreates a new calendar file for the target year by combining all event sources:
Features:
- Fetches Israeli calendar events and holidays
- Fetches US holidays and events
- Processes birthdays, death anniversaries, and expiration dates
- Creates recurring tasks (daily, weekly, weekend patterns)
- Combines all events into a single organized calendar file
- Saves output to
dist/event-dates-YYYY.txt
Usage:
npm startValidates and identifies unmarked tasks in calendar files:
Features:
- Scans calendar files for tasks without proper markers
- Identifies formatting issues
- Reports statistics
Usage:
npm run scanCreates a timestamped backup of the entire project:
Features:
- Automatically excludes directories:
.git,dist,node_modules,sources - Includes hidden files like
.gitignore - Creates versioned backups in the configured backups directory
Usage:
npm run backupRuns sandbox tests for experimental features:
Usage:
npm run sandevent-dates-calendar/
├── src/
│ ├── core/ # Models, enums, and core structures
│ │ ├── enums/ # Enumeration types
│ │ └── models/ # Data models
│ ├── culture/ # Text constants and dictionaries
│ ├── logics/ # Main business logic orchestration
│ ├── scripts/ # Entry point scripts
│ ├── services/ # Service layer (events, paths, logs, etc.)
│ ├── settings/ # Configuration settings
│ ├── tests/ # Test files
│ └── utils/ # Utility functions
├── sources/ # Source calendar files (previous years)
├── dist/ # Generated output files
├── CONTRIBUTING.md # Contribution guidelines
├── INSTRUCTIONS.md # Detailed usage instructions
├── LICENSE # MIT License
└── package.json
This project follows clean architecture principles:
- Separation of Concerns: Code organized by purpose (models, services, scripts, utils, settings)
- Service-Oriented Architecture: Business logic encapsulated in services
- Configuration Management: Centralized settings for easy customization
- Error Handling: Structured error handling with meaningful messages
- Validation System: Comprehensive validation for inputs and data
- Testability: Modular design for easy testing
- Service Pattern: Business logic encapsulated in services (EventService, PathService, etc.)
- Singleton Pattern: Service instances managed for consistency
- Factory Pattern: Dynamic event creation based on types
- Strategy Pattern: Different validation strategies for various data types
- Configuration First: Always check and validate settings before execution
- Backup Before Changes: Automatic backups prevent data loss
- Source Data Validation: Validate all input data before processing
- Polite Crawling: Rate limiting and proper user agents for web scraping
- Logging Everything: Detailed logs for debugging and monitoring
- Consistent Formatting: Standardized event formats across sources
For questions, issues, or contributions:
- GitHub Issues: https://github.com/orassayag/event-dates-calendar/issues
- Email: orassayag@gmail.com
- Configuration: User sets the target year and source file path in settings
- Validation: Application validates internet connection and URLs
- Data Collection:
- Reads previous year's calendar file for recurring events
- Fetches Israeli holidays and events from online source
- Fetches US holidays from online source
- Processes birthdays, anniversaries, and expiration dates
- Event Processing:
- Calculates ages for birthdays
- Calculates years since for death anniversaries
- Generates recurring tasks based on patterns
- Combines all events into daily entries
- Output Generation: Creates organized TXT file with all events for the entire year
- Backup: Optionally creates timestamped project backup
The calendar supports various event types:
- Birthdays: With automatic age calculation
- Death Anniversaries: With years since calculation
- Expiration Dates: For subscriptions, documents, services
- Israeli Holidays: Fetched from online calendar
- US Holidays: Fetched and included in calendar
- Recurring Tasks: Daily, weekly, or monthly patterns
- Weekend Tasks: Every weekend or every second weekend
- Static Events: Manually defined special dates
The generated calendar file contains:
- Daily entries for the entire year
- Clear date headers (e.g., "01/01/2025 - יום ראשון")
- Event descriptions with markers and symbols
- Automatic age/year calculations
- Organized sections for different event types
- Hebrew and English text support
The project uses:
- JavaScript ES6+ with modern module syntax
- ESLint for code quality
- jsdom for HTML parsing and web scraping
- fs-extra for enhanced file operations
- is-reachable for URL validation
Contributions to this project are released to the public under the project's open source license.
Everyone is welcome to contribute. Contributing doesn't just mean submitting pull requests—there are many different ways to get involved, including answering questions, reporting issues, improving documentation, or suggesting new features.
Please read CONTRIBUTING.md for details on the code of conduct and the process for submitting pull requests.
For detailed usage instructions, see INSTRUCTIONS.md.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Or Assayag - Initial work - orassayag
- Or Assayag orassayag@gmail.com
- GitHub: https://github.com/orassayag
- StackOverflow: https://stackoverflow.com/users/4442606/or-assayag?tab=profile
- LinkedIn: https://linkedin.com/in/orassayag
This application has an MIT license - see the LICENSE file for details.
- Built for educational and research purposes
- Respects robots.txt and implements rate limiting
- Uses user-agent rotation to avoid detection
- Implements polite crawling practices