Build the JAR file from the project root:
./gradlew jarThe JAR will be created at: build/libs/calendar-1.0.jar
Type commands one at a time and see immediate results:
java -jar build/libs/calendar-1.0.jar --mode interactiveExecute commands from a file:
java -jar build/libs/calendar-1.0.jar --mode headless <filepath>Note: Arguments are case-insensitive (--MODE, --mode, etc.)
The res/ folder contains sample files to help you understand and test the application:
Purpose: Comprehensive demonstration of all valid commands
Use Case:
- Learn all command formats by example
- See how to create single events, recurring events, and all-day events
- Understand the 3 edit scopes:
edit event,edit events,edit series - Run as a complete test:
java -jar build/libs/calendar-1.0.jar --mode headless res/commands.txt
Contains: 41 commands covering:
- Creating 17 different types of events (single, recurring, all-day)
- Editing with all 6 properties (subject, start, end, location, description, status)
- Querying calendar by date and range
- Checking busy/available status
- Exporting to CSV
Purpose: Test error handling with common user mistakes
Use Case:
- Understand what commands are invalid and why
- See helpful error messages for debugging
- Test the application's robustness
- Run to see error handling:
java -jar build/libs/calendar-1.0.jar --mode headless res/invalid.txt
Contains: 40+ invalid commands demonstrating:
- Missing required fields (subject, dates, times)
- Invalid date/time formats (day 32, month 13, hour 25)
- Logical errors (start time after end time)
- Invalid recurring patterns
- Duplicate event attempts
- Malformed edit and export commands
Purpose: Complete output log from running commands.txt in headless mode
Use Case:
- See the exact output generated when running
res/commands.txt - Verify that all 41 commands executed correctly
- Reference for expected application behavior and output format
- Useful for debugging - compare your output with this reference
Contains:
- All command inputs prefixed with
> - Success messages for each create, edit, and export operation
- Complete print output showing all events with locations and times
- Status checks (BUSY/AVAILABLE)
- Final export confirmation with file path
Purpose: Sample exported calendar in Google Calendar format
Use Case:
- This is the CSV file that is generated after running
res/commands.txt - See the CSV format generated by the
export calcommand - Import this file into Google Calendar to verify compatibility
- Use as a template for understanding the export format
Import to Google Calendar:
- Open Google Calendar
- Settings → Import & Export → Import
- Select
april2025_calendar.csv - View your events in April 2025
Purpose: Screenshot of the exported calendar imported into Google Calendar
Use Case:
- This is the screenshot of Google Calendar when
april2025_calendar.csvis uploaded - Visual confirmation that the application works correctly
- See how events appear in Google Calendar after import
- Verify that single events, recurring events, and all-day events display properly
Shows: April 2025 calendar with ~35 events including:
- Single events (meetings, appointments, parties)
- Recurring patterns (lectures, gym sessions, standups)
- All-day events (Earth Day, Training Days)
Purpose: UML class diagram of the application architecture
Use Case:
- Understand the MVC (Model-View-Controller) design pattern
- See relationships between classes and interfaces
- Reference for code structure and design decisions
Shows:
- Model:
Calendar,Event,EventStatus,EventProperty - View:
CalendarView,CalendarViewImpl - Controller:
CalendarController,CalendarControllerImpl - Utilities:
CommandParser,CsvFormatter,FileSystemUtils - DTOs: Command objects for parsing
java -jar build/libs/calendar-1.0.jar --mode interactive> create event "Team Meeting" from 2025-04-08T14:00 to 2025-04-08T15:30
Event created: Team Meeting
> print events on 2025-04-08
- Team Meeting from 14:00 to 15:30
> exit
Exiting.
java -jar build/libs/calendar-1.0.jar --mode headless res/commands.txtCreates a full April 2025 calendar and exports to april2025_calendar.csv
java -jar build/libs/calendar-1.0.jar --mode headless res/invalid.txtSee how the application handles 40+ different types of errors
create event "Meeting" from 2025-04-08T14:00 to 2025-04-08T15:30
create event "Holiday" on 2025-04-22
create event "Lecture" from 2025-04-01T10:00 to 2025-04-01T11:30 repeats TR for 8 times
edit event subject "Meeting" from 2025-04-08T14:00 to 2025-04-08T15:30 with NewName
edit events location "Lecture" from 2025-04-01T10:00 with RoomB301
edit series description "Lecture" from 2025-04-01T10:00 with Description
print events on 2025-04-08
print events from 2025-04-01T00:00 to 2025-04-30T23:59
show status on 2025-04-08T14:30
export cal my_calendar.csv
exit
- All-Day Events: Default to 8:00 AM - 5:00 PM
- Date Format: YYYY-MM-DD (e.g., 2025-04-08)
- DateTime Format: YYYY-MM-DDThh:mm (e.g., 2025-04-08T14:00)
- Weekday Codes: M (Mon), T (Tue), W (Wed), R (Thu), F (Fri), S (Sat), U (Sun)
- Multi-word subjects: Use double quotes when creating
- Exit command: Required in all command files
JAR not found? → Run ./gradlew jar first
File not found in headless mode? → Run from project root
Commands not working? → Check date/time format and use quotes for multi-word subjects
CSV export location? → The application prints the full path after export
For detailed command syntax and more examples, refer to res/commands.txt for valid commands and res/invalid.txt for error cases.