Skip to content

feat: show section schedules on the course Dates tab - #26

Merged
choeying-10 merged 1 commit into
wbc-ulmo1-stagefrom
feat/schedule-feature
Oct 14, 2026
Merged

choeying-10 merged 1 commit into
wbc-ulmo1-stagefrom
feat/schedule-feature

Conversation

@choeying-10

@choeying-10 choeying-10 commented Oct 14, 2026 •

Copy link
Copy Markdown

Summary

  • Load taught sessions from GET /api/course-schedule/v1/{course_id}/ separately from the existing course dates API, and show them as cards on the Dates tab.
  • Group both assignments and sessions into Monday-Sunday weeks. A session is shown once, on its start date, with the course timezone's wall-clock time.
  • If the schedule API is off, the course is self-paced, or the request fails, the existing Dates tab still renders. Sessions are not added to Completed or calendar sync.
image image

@choeying-10 choeying-10 self-assigned this Oct 14, 2026
* A week runs Monday through Sunday. "This week" is the rest of the current
* week after today, and "next week" is the following Monday through Sunday.
*/
fun classifyCalendarDay(date: Date, today: Date = Date()): DatesSection {
fun sundayOfWeek(day: Date): Date {
val calendar = Calendar.getInstance()
calendar.time = day.clearTime()
val daysUntilSunday = (Calendar.SUNDAY - calendar.get(Calendar.DAY_OF_WEEK) + 7) % 7
fun sundayOfWeek(day: Date): Date {
val calendar = Calendar.getInstance()
calendar.time = day.clearTime()
val daysUntilSunday = (Calendar.SUNDAY - calendar.get(Calendar.DAY_OF_WEEK) + 7) % 7
*
* These values are wall-clock dates, so they are not parsed as UTC instants.
*/
fun parseWallDate(isoDate: String): Date? {
*/
fun parseWallDate(isoDate: String): Date? {
val parts = isoDate.split("-")
if (parts.size != 3) {
val minute = parts.getOrNull(1)?.padStart(2, '0') ?: "00"
val suffix = if (hour < 12) "am" else "pm"
val hour12 = when (hour) {
0, 12 -> 12
val minute = parts.getOrNull(1)?.padStart(2, '0') ?: "00"
val suffix = if (hour < 12) "am" else "pm"
val hour12 = when (hour) {
0, 12 -> 12
val suffix = if (hour < 12) "am" else "pm"
val hour12 = when (hour) {
0, 12 -> 12
in 13..23 -> hour - 12
val suffix = if (hour < 12) "am" else "pm"
val hour12 = when (hour) {
0, 12 -> 12
in 13..23 -> hour - 12
val suffix = if (hour < 12) "am" else "pm"
val hour12 = when (hour) {
0, 12 -> 12
in 13..23 -> hour - 12

@yogeshbhagatcode yogeshbhagatcode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@choeying-10 There are lots of github-security comments. Can you please look into them and see if we have any issue?

@choeying-10

Copy link
Copy Markdown
Author

@choeying-10 There are lots of github-security comments. Can you please look into them and see if we have any issue?

they are only Detekt code-style warnings about return counts and unnamed numbers, not security or functional issues.

@choeying-10
choeying-10 merged commit 0628add into wbc-ulmo1-stage Oct 14, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants