You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/quiz-selector.sh
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,9 @@ else
38
38
check_jq() { command -v jq &>/dev/null; }
39
39
fi
40
40
41
+
# shellcheck source=scripts/lib/date-compat.sh
42
+
source"$PLUGIN_ROOT/scripts/lib/date-compat.sh"
43
+
41
44
# Default output if we can't determine anything
42
45
DEFAULT_OUTPUT='{"mode":"dynamic","concept":null,"reason":"No profile data available","static_question":null,"belt":"white","quiz_format":"multiple_choice"}'
43
46
@@ -89,8 +92,8 @@ if [ $? -ne 0 ]; then
89
92
CORRECT_QUIZZES=0
90
93
fi
91
94
92
-
TODAY=$(date -u +%Y-%m-%d)
93
-
NOW_EPOCH=$(date +%s)
95
+
TODAY=$(date_today)
96
+
NOW_EPOCH=$(date_to_epoch "$TODAY")
94
97
95
98
# Determine quiz format based on belt level
96
99
# Orange Belt+ gets a mix of formats; lower belts get multiple choice
@@ -149,10 +152,10 @@ if [ "$QUIZ_HISTORY" != "[]" ]; then
149
152
continue
150
153
fi
151
154
152
-
# Calculate days since last wrong answer (handles both GNU and BSD date)
155
+
# Calculate days since last wrong answer using cross-platform helpers
0 commit comments