I Fought the Clock-In System, and I Won (Mostly)

The Clock-In Chronicles: Welcome to Clockageddon

Let me paint you a picture: It’s 1:37 AM, the office is dark, my code editor is glowing like a judgmental nightlight, and a message pops up on my screen.

“Can someone explain why the system says Zack worked 16 hours? He left before lunch.”

My clock-in system—yes, the one I built myself—was betraying me.

On the surface, everything looked fine. It tracked check-ins, recorded timestamps, and exported reports. But the moment something unusual happened—like someone forgetting to clock out or working a shift that crossed midnight—the system fell apart. Admins were helpless. All they could do was stare at the inaccurate record and whisper “Why?” into the void.

That’s when I knew: It was time to fix it. Properly.

Finally, Admins Can Fix Things (Without Crying into Excel)

In the early days, if someone forgot to clock out, there were only two options:
(1) guess the right time and mentally calculate hours worked, or
(2) pretend nothing happened and pray the payroll gods were kind.

Admins couldn’t edit records. My clock-in system had all the flexibility of a traffic cone. So I changed that.

Now, admins can edit attendance entries directly. They can adjust clock-in and clock-out times, leave notes, and instantly preview the recalculated totals—no spreadsheets, no manual math, no coffee-fueled panic.

This wasn’t just a feature—it was a lifeline for the people using it daily. And it finally made the software live up to its promise.

Auto-Calculations: The Math Nobody Wanted to Do

With editing came a whole new challenge: calculations.

It wasn’t enough to just change times—I had to make sure the system recalculated everything accurately, immediately, and consistently. So I built what I now lovingly call the auto-calculation engine.

It processes:

  • Total hours worked

  • Night shift duration (because shifts don’t end at 6 PM)

  • Overtime based on buffer settings

  • Late arrivals and early departures

  • Cross-day shifts without treating them like quantum events

This logic used to live in the minds of supervisors and payroll staff. Now, it lives in code. And it doesn’t forget things. Ever.

The Great Date Format Rebellion

I learned—very quickly—that formatting dates in the American style (MM/DD/YYYY) was asking for trouble. Especially in Malaysia.

I thought “06/07” looked fine. Users thought it meant July 6. Chaos ensued.

So I went full-on format warrior. I combed through every date-rendering line in the codebase—from dashboards to mobile cards to PDF exports—and standardized them to DD/MM/YYYY.

It was exhausting. Like chasing gremlins with a calendar. But the result was worth every bit of frustration. Now, when users see a date, they actually know what day it is.

Revolutionary.

Role-Based Access: Keeping the Chaos Contained

One thing became painfully clear: not everyone should have the power to edit attendance records.

So I implemented a simple, effective role-based access control system:

  • Admins can view and edit everything.

  • Managers can view all records but can’t make changes.

  • Employees can’t access the module at all—just clock in, clock out, and carry on.

It was like being the bouncer at my own nightclub: “If your role’s not on the list, you’re not getting in.”

And guess what? No more junior staff accidentally logging themselves as working 36 hours in a day.

Making Mobile Edits Not Terrible

When I added editing capabilities, I didn’t want them limited to a desktop. I knew admins would need to make changes from their phones—in the field, at events, even while waiting for their coffee.

So I reworked the mobile interface with responsive cards, large buttons (for fat fingers), and a clean “Edit” action at the bottom. It’s simple, snappy, and doesn’t break on small screens.

Now admins can correct a clock-in record from anywhere—without rage-scrolling or pinch-zooming through broken layouts.

The Edit Dialog: Where the Magic Happens

This is the heart of it all.

When an admin clicks “Edit,” they get a sleek dialog box with:

  • Employee details (photo, name, ID, department)

  • Clock-in and clock-out date/time pickers

  • A notes field for context (or passive-aggressive commentary)

  • Live preview of calculated hours, night shifts, and late/early flags

The dialog also includes built-in validation. If you try to clock someone out before they clocked in, it’ll stop you with a firm but polite warning.

Unless your staff can time travel—which, if they can, I’ve got follow-up questions.

Security: Because I Know Better Now

I wasn’t about to let anyone edit time records without proper checks.

So I secured everything:

  • JWT tokens verify each user’s identity.

  • Middleware ensures only admins can reach the edit endpoint.

  • Every change is logged—with timestamps, user IDs, and before/after values.

Security isn’t just about locking people out. It’s about protecting trust. Now, I have an audit trail for every edit, just in case someone suddenly claims they worked 18 hours straight on a Sunday.

Launch Day and the Sweet Taste of Redemption

I pushed the update live sometime around 3:15 AM (classic move). Then I waited.

Within an hour, I got a message from one of the admins:

“Hey, I just fixed the morning shift error. The system recalculated everything instantly. This is amazing.”

And in that moment, I felt like a hero. Not the kind with a cape. The kind with version control and too much coffee in their system.

Lessons I Learned Fixing My Own Clock-In System

  1. If admins can’t fix time entries, they will fixate on you instead.

  2. Auto-calculations are life-changing. Seriously.

  3. Date formats are not “small details.” They are wars.

  4. People will edit on mobile, whether you want them to or not.

  5. Testing isn’t optional. It’s survival.

 

Peace at Last (Sort Of)

In case you missed how this all began: Building a Web-Based Clocking System: A 48-Hour Sprint (and a Latte or Two)

Today, my clock-in system is smarter, leaner, and no longer terrifying to use. Admins can fix things. Managers can review without fear. Employees can rest easy knowing they’re clocked-in properly—even if they forgot to clock out again (looking at you, Zack).

And best of all? I haven’t gotten a 2 AM message about a 28-hour shift in weeks.

(Unless time travel finally becomes a thing. But I’m saving that for Q3.)

Previous Article

The Future of Humans and AI in the Next 5 Years

Next Article

The Night I Fixed Night Shifts and Made WhatsApp Shut Up

Write a Comment

Leave a Comment

Subscribe to our Newsletter

Subscribe to our email newsletter to get the latest posts delivered right to your email.
Pure inspiration, zero spam ✨