Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master to main #3

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 25 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ RustyTUICalendar is a terminal-based calendar application written in Rust. It le
## Features

- Display a monthly calendar starting from Sunday
- Add, edit, and delete events
- Add and delete events
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not directly let users delete. Only from JSON

- Highlight current date
- Add, edit and delete To-Do list
- Add and delete To-Do list
- User-friendly terminal interface

## Installation
Expand All @@ -17,22 +17,41 @@ To install RustyTUICalendar, you need to have Rust and Cargo installed on your s
Clone the repository:

```sh
git clone https://github.com/soumyasen1809/RustyTUICalendar.git
cd RustyTUICalendar
$ git clone https://github.com/soumyasen1809/RustyTUICalendar.git
$ cd RustyTUICalendar
```

Build the project:

```sh
cargo build --release
$ cargo build --release
```

Run the application:

```sh
cargo run
$ cargo run
```

## Features
Press F3 to start typing your commands.

- **Add Events to ToDo or Calendar**: If the input specifies `todo`, it adds the event to the ToDo list. If the input specifies `app`, it adds the appointment to the calendar.
```sh
$ app, 2024-09-14 13:14:50, Appointment Title, Appointment Location
$ todo, true, Todo Title
```
- **Search for an Appointment**: If the input specifies `search`, it searches for the appointment in the calendar for the given date.
```sh
$ find, 2024-09-14
```
- **Jump to Today**: If the input specifies `today`, it sets the calendar date to the current date.
```sh
$ today
```

Additionally, press F1 and F2 to move to previous and next months respectively.

## Contributing

Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.
Expand Down
4 changes: 2 additions & 2 deletions assets/appointments.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
"location": "Lounge C"
},
{
"date": "2024-09-08 15:00:00",
"date": "2024-09-09 15:00:00",
"event_name": "Old Team Meeting",
"location": "Online: https://teams.microsoft.com/l/meetup-join/19%3ameeting_NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2%40thread.v2/0?context=%7b%22Tid%22%3a%22your-tenant-id%22%2c%22Oid%22%3a%22your-object-id%22%7d"
},
{
"date": "2024-09-08 07:09:34",
"date": "2024-09-09 07:09:34",
"event_name": "Have a demo ready",
"location": "Library"
}
Expand Down
4 changes: 3 additions & 1 deletion src/to_do_widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ fn write_user_input_to_json(
}
} else if parts_input.len() == 2 {
// Search for an appointment
if parts_input[0].trim().to_lowercase().contains("find") {
if (parts_input[0].trim().to_lowercase().contains("find"))
|| parts_input[0].trim().to_lowercase().contains("search")
{
if parts_input[1].clone().len() < 19 {
// If less than 19, then it is in NaiveDate format => need to change it to NaiveDateTime
let date_time_formated =
Expand Down