Utility
2023
Creator & Maintainer

UTHM Week Tracker

Simple web utility to track university weeks - now used by classmates

UTHM Week Tracker preview

Overview

A lightweight web utility designed to help UTHM students track academic weeks throughout the semester. What started as a personal tool has grown into a widely-used resource among classmates. The application calculates the current academic week based on the university calendar, helping students stay organized and plan their coursework effectively. Its simplicity and reliability have made it an essential tool for the student community.

Code Highlight

Week Calculation Logic

javascript
function calculateCurrentWeek() {
  const semesterStart = new Date('2024-09-01');
  const today = new Date();
  
  // Calculate days difference
  const diffTime = Math.abs(today - semesterStart);
  const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
  
  // Calculate week number (accounting for breaks)
  const breaks = [
    { start: new Date('2024-10-15'), end: new Date('2024-10-22') },
    { start: new Date('2024-12-20'), end: new Date('2025-01-05') }
  ];
  
  let breakDays = 0;
  breaks.forEach(breakPeriod => {
    if (today > breakPeriod.start) {
      const breakEnd = today < breakPeriod.end ? today : breakPeriod.end;
      breakDays += Math.ceil((breakEnd - breakPeriod.start) / (1000 * 60 * 60 * 24));
    }
  });
  
  const weekNumber = Math.ceil((diffDays - breakDays) / 7);
  return weekNumber;
}

Performance Metrics

Load Time

< 100ms

Bundle Size

< 10KB

Lighthouse Score

100/100

Challenges

  • 1Accurately calculating weeks across semester breaks
  • 2Ensuring reliability without a backend
  • 3Creating an intuitive UX with minimal UI

Outcomes & Impact

Used by 100+ students daily

Featured in student WhatsApp groups

Zero downtime since launch

Gallery

UTHM Week Tracker screenshot 1
UTHM Week Tracker screenshot 2

Tech Stack

JavaScriptHTMLCSSWeb APIsLocalStorage

Features

  • Automatic week calculation based on academic calendar
  • Clean and intuitive interface
  • Offline functionality with LocalStorage
  • Mobile-responsive design
  • Zero dependencies for fast loading