Skip to content

A feature-rich Java calendar application with interactive and headless CLI modes. Create single/recurring/all-day events, edit with granular scopes, query availability, and export to Google Calendar-compatible CSV. Built with MVC architecture. Includes comprehensive test files and Google Calendar import validation.

License

Notifications You must be signed in to change notification settings

Naveen-1-1/calendar-application

Repository files navigation

Calendar Application - User Guide

Building the Application

Build the JAR file from the project root:

./gradlew jar

The JAR will be created at: build/libs/calendar-1.0.jar


Running the Application

Interactive Mode

Type commands one at a time and see immediate results:

java -jar build/libs/calendar-1.0.jar --mode interactive

Headless Mode

Execute commands from a file:

java -jar build/libs/calendar-1.0.jar --mode headless <filepath>

Note: Arguments are case-insensitive (--MODE, --mode, etc.)


Reference Files in res/ Folder

The res/ folder contains sample files to help you understand and test the application:

1. commands.txt

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

2. invalid.txt

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

3. april2025.txt

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

4. april2025_calendar.csv

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 cal command
  • Import this file into Google Calendar to verify compatibility
  • Use as a template for understanding the export format

Import to Google Calendar:

  1. Open Google Calendar
  2. Settings → Import & Export → Import
  3. Select april2025_calendar.csv
  4. View your events in April 2025

5. april2025_calendar.png

Purpose: Screenshot of the exported calendar imported into Google Calendar

Use Case:

  • This is the screenshot of Google Calendar when april2025_calendar.csv is 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)

6. Class Diagram.png

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

Quick Start Examples

Example 1: Interactive Session

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.

Example 2: Run Complete Test

java -jar build/libs/calendar-1.0.jar --mode headless res/commands.txt

Creates a full April 2025 calendar and exports to april2025_calendar.csv

Example 3: Test Error Handling

java -jar build/libs/calendar-1.0.jar --mode headless res/invalid.txt

See how the application handles 40+ different types of errors


Basic Command Format

Create Events

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 Events

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

Query Calendar

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 & Exit

export cal my_calendar.csv
exit

Important Notes

  • 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

Troubleshooting

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.

About

A feature-rich Java calendar application with interactive and headless CLI modes. Create single/recurring/all-day events, edit with granular scopes, query availability, and export to Google Calendar-compatible CSV. Built with MVC architecture. Includes comprehensive test files and Google Calendar import validation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages