From 4d24b34fb7c050c6e68f8ee2e83de9629bcee035 Mon Sep 17 00:00:00 2001
From: "Douglas B. Rumbaugh" <doug@douglasrumbaugh.com>
Date: Mon, 12 Jan 2026 12:56:55 -0500
Subject: Support for arbitrary minutes in times

Times will get rounded internally to the nearest
15 minutes for display purposes.
---
 weekschedule.cls | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

(limited to 'weekschedule.cls')

diff --git a/weekschedule.cls b/weekschedule.cls
index abc35be..75925b3 100644
--- a/weekschedule.cls
+++ b/weekschedule.cls
@@ -135,10 +135,18 @@
 % ============================================
 % Internal time parsing
 % ============================================
-% Parse time to decimal (e.g., "9:30" -> 9.5)
+% Parse time to decimal and round to nearest 15-minute interval
+% (e.g., "9:04" -> 9.0, "9:14" -> 9.25)
 \def\@parsetime#1{\@@parsetime#1\@nil}
 \def\@@parsetime#1:#2\@nil{%
-    \pgfmathparse{#1 + #2/60}%
+    % Convert to total minutes
+    \pgfmathparse{#1 * 60 + #2}%
+    \pgfmathtruncatemacro{\@totalminutes}{\pgfmathresult}%
+    % Round to nearest 15 minutes
+    \pgfmathparse{round(\@totalminutes/15)*15}%
+    \pgfmathtruncatemacro{\@roundedminutes}{\pgfmathresult}%
+    % Convert back to decimal hours
+    \pgfmathparse{\@roundedminutes/60}%
     \edef\@parsedtime{\pgfmathresult}%
 }
 
-- 
cgit v1.2.3

