Fix calendar event fetching to use visible date range
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				Build and Push Docker Image / docker (push) Failing after 1m7s
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	Build and Push Docker Image / docker (push) Failing after 1m7s
				
			Moved event fetching logic from CalendarView to Calendar component to properly use the visible date range instead of hardcoded current month. The Calendar component already tracks the current visible date through navigation, so events now load correctly for August and other months when navigating. Changes: - Calendar component now manages its own events state and fetching - Event fetching responds to current_date changes from navigation - CalendarView simplified to just render Calendar component - Fixed cargo fmt/clippy formatting across codebase 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
		| @@ -39,30 +39,32 @@ pub fn CreateCalendarModal(props: &CreateCalendarModalProps) -> Html { | ||||
|         let error_message = error_message.clone(); | ||||
|         let is_creating = is_creating.clone(); | ||||
|         let on_create = props.on_create.clone(); | ||||
|          | ||||
|  | ||||
|         Callback::from(move |e: SubmitEvent| { | ||||
|             e.prevent_default(); | ||||
|              | ||||
|  | ||||
|             let name = (*calendar_name).trim(); | ||||
|             if name.is_empty() { | ||||
|                 error_message.set(Some("Calendar name is required".to_string())); | ||||
|                 return; | ||||
|             } | ||||
|              | ||||
|  | ||||
|             if name.len() > 100 { | ||||
|                 error_message.set(Some("Calendar name too long (max 100 characters)".to_string())); | ||||
|                 error_message.set(Some( | ||||
|                     "Calendar name too long (max 100 characters)".to_string(), | ||||
|                 )); | ||||
|                 return; | ||||
|             } | ||||
|              | ||||
|  | ||||
|             error_message.set(None); | ||||
|             is_creating.set(true); | ||||
|              | ||||
|  | ||||
|             let desc = if (*description).trim().is_empty() { | ||||
|                 None | ||||
|             } else { | ||||
|                 Some((*description).clone()) | ||||
|             }; | ||||
|              | ||||
|  | ||||
|             on_create.emit((name.to_string(), desc, (*selected_color).clone())); | ||||
|         }) | ||||
|     }; | ||||
| @@ -90,7 +92,7 @@ pub fn CreateCalendarModal(props: &CreateCalendarModalProps) -> Html { | ||||
|                         {"×"} | ||||
|                     </button> | ||||
|                 </div> | ||||
|                  | ||||
|  | ||||
|                 <form class="modal-body" onsubmit={on_submit}> | ||||
|                     { | ||||
|                         if let Some(ref error) = *error_message { | ||||
| @@ -103,10 +105,10 @@ pub fn CreateCalendarModal(props: &CreateCalendarModalProps) -> Html { | ||||
|                             html! {} | ||||
|                         } | ||||
|                     } | ||||
|                      | ||||
|  | ||||
|                     <div class="form-group"> | ||||
|                         <label for="calendar-name">{"Calendar Name *"}</label> | ||||
|                         <input  | ||||
|                         <input | ||||
|                             id="calendar-name" | ||||
|                             type="text" | ||||
|                             value={(*calendar_name).clone()} | ||||
| @@ -116,7 +118,7 @@ pub fn CreateCalendarModal(props: &CreateCalendarModalProps) -> Html { | ||||
|                             disabled={*is_creating} | ||||
|                         /> | ||||
|                     </div> | ||||
|                      | ||||
|  | ||||
|                     <div class="form-group"> | ||||
|                         <label for="calendar-description">{"Description"}</label> | ||||
|                         <textarea | ||||
| @@ -128,7 +130,7 @@ pub fn CreateCalendarModal(props: &CreateCalendarModalProps) -> Html { | ||||
|                             disabled={*is_creating} | ||||
|                         /> | ||||
|                     </div> | ||||
|                      | ||||
|  | ||||
|                     <div class="form-group"> | ||||
|                         <label>{"Calendar Color"}</label> | ||||
|                         <div class="color-grid"> | ||||
| @@ -143,13 +145,13 @@ pub fn CreateCalendarModal(props: &CreateCalendarModalProps) -> Html { | ||||
|                                             selected_color.set(Some(color.clone())); | ||||
|                                         }) | ||||
|                                     }; | ||||
|                                      | ||||
|                                     let class_name = if is_selected {  | ||||
|                                         "color-option selected"  | ||||
|                                     } else {  | ||||
|                                         "color-option"  | ||||
|  | ||||
|                                     let class_name = if is_selected { | ||||
|                                         "color-option selected" | ||||
|                                     } else { | ||||
|                                         "color-option" | ||||
|                                     }; | ||||
|                                      | ||||
|  | ||||
|                                     html! { | ||||
|                                         <button | ||||
|                                             key={index} | ||||
| @@ -165,18 +167,18 @@ pub fn CreateCalendarModal(props: &CreateCalendarModalProps) -> Html { | ||||
|                         </div> | ||||
|                         <p class="color-help-text">{"Optional: Choose a color for your calendar"}</p> | ||||
|                     </div> | ||||
|                      | ||||
|  | ||||
|                     <div class="modal-actions"> | ||||
|                         <button  | ||||
|                             type="button"  | ||||
|                         <button | ||||
|                             type="button" | ||||
|                             class="cancel-button" | ||||
|                             onclick={props.on_close.reform(|_| ())} | ||||
|                             disabled={*is_creating} | ||||
|                         > | ||||
|                             {"Cancel"} | ||||
|                         </button> | ||||
|                         <button  | ||||
|                             type="submit"  | ||||
|                         <button | ||||
|                             type="submit" | ||||
|                             class="create-button" | ||||
|                             disabled={*is_creating} | ||||
|                         > | ||||
| @@ -193,4 +195,4 @@ pub fn CreateCalendarModal(props: &CreateCalendarModalProps) -> Html { | ||||
|             </div> | ||||
|         </div> | ||||
|     } | ||||
| } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Connor Johnstone
					Connor Johnstone