Daily Time Record (DTR)
A schedule-aware, high-fidelity log grid built for government personnel systems. Dynamically renders punch columns from a ScheduleConfig, computes actual hours from time logs, and supports hover-triggered manual punch correction slips. Works with standard, straight, night, and custom shift schedules.
Interactive Demo
A visual employee timecard with live status matrices and an adjustment request panel.
DTR Portal Interactive Demo
Hover over or click the --- in Oct 12 (AM In log missing) to file a DTR adjustment request. You can also click the edit triggers on existing logs.
Nehry Dedoro
| Date | AM In | AM Out | PM In | PM Out | Overtime | Total | Status |
|---|---|---|---|---|---|---|---|
| 01Thu | 07:52 AM | 12:02 PM | 12:58 PM | 05:04 PM | - | 8.3 | Regular |
| 02Fri | 07:48 AM | 12:01 PM | 12:55 PM | 05:02 PM | - | 8.3 | Regular |
| 03Sat | - | - | - | - | - | - | Weekend |
| 04Sun | - | - | - | - | - | - | Weekend |
| 05Mon | 08:15 AM | 12:03 PM | 12:59 PM | 05:01 PM | - | 7.6 | Late |
| 06Tue | 07:54 AM | 12:02 PM | 01:00 PM | 05:03 PM | - | 8.2 | Regular |
| 07Wed | 07:50 AM | 12:05 PM | 12:58 PM | 05:00 PM | - | 8.3 | Regular |
| 08Thu | - | - | - | - | - | - | Holiday |
| 09Fri | --- | --- | --- | --- | - | - | On Leave |
| 10Sat | - | - | - | - | - | - | Weekend |
| 11Sun | - | - | - | - | - | - | Weekend |
| 12Mon | --- | 12:01 PM | 12:56 PM | 05:03 PM | - | 4.1 | Regular |
| 13Tue | 07:53 AM | 12:02 PM | 12:57 PM | 05:05 PM | - | 8.3 | Regular |
| 14Wed | 07:55 AM | 12:01 PM | 12:58 PM | 04:30 PM | - | 7.1 | Undertime |
| 15Thu | 07:51 AM | 12:03 PM | 12:59 PM | 05:04 PM | - | 8.3 | Regular |
Installation
Install the DailyTimeRecord component.
pnpm dlx shadcn@latest add https://micto-ui-kit.misangono.net/r/micto/daily-time-record.jsonBasic Usage
Render a simple read-only DTR calendar view. Pass a schedule preset and your log data.
import { DailyTimeRecord, SCHEDULE_STANDARD } from "@/components/micto/daily-time-record";
const logs = [
{
date: "2026-10-01",
punches: { amIn: "07:52 AM", amOut: "12:02 PM", pmIn: "12:58 PM", pmOut: "05:04 PM" },
status: "regular",
},
{
date: "2026-10-02",
punches: { amIn: "07:48 AM", amOut: "12:01 PM", pmIn: "12:55 PM", pmOut: "05:02 PM" },
status: "regular",
},
{
date: "2026-10-03",
punches: {},
status: "weekend",
},
{
date: "2026-10-04",
punches: {},
status: "weekend",
},
];
export default function SimpleDtr() {
return (
<DailyTimeRecord
employeeId="2026-1082"
employeeName="Nehry Dedoro"
department="Municipal Information and Communications Technology Office"
position="Information Systems Analyst II"
month="October 2026"
schedule={SCHEDULE_STANDARD}
logs={logs}
/>
);
}Schedule Configuration
The component dynamically generates columns from the schedule config. Use built-in presets or define custom schedules from your backend data.
import {
SCHEDULE_STANDARD,
SCHEDULE_STRAIGHT,
SCHEDULE_NIGHT,
} from "@/components/micto/daily-time-record";
import type { ScheduleConfig } from "@/components/micto/daily-time-record";
// Use a built-in preset
<DailyTimeRecord schedule={SCHEDULE_STANDARD} ... />
// Or define a custom schedule from backend data
const customSchedule: ScheduleConfig = {
name: "Split Shift",
slots: [
{ key: "morningIn", label: "Morning In", expectedTime: "06:00", type: "in" },
{ key: "morningOut", label: "Morning Out", expectedTime: "10:00", type: "out" },
{ key: "eveningIn", label: "Evening In", expectedTime: "16:00", type: "in" },
{ key: "eveningOut", label: "Evening Out", expectedTime: "20:00", type: "out" },
],
expectedDailyHours: 8,
breakMinutes: 0,
tardinessGraceMinutes: 15,
};
<DailyTimeRecord schedule={customSchedule} ... />Time Adjustments (Correction Sheets)
Wire up the onFileAdjustment callback to trigger manual punch adjustment slips whenever time logs are missing or require changes.
import * as React from "react";
import { DailyTimeRecord, SCHEDULE_STANDARD } from "@/components/micto/daily-time-record";
export default function InteractiveDtr() {
const [logs, setLogs] = React.useState([
{
date: "2026-10-12",
punches: { amOut: "12:01 PM", pmIn: "12:56 PM", pmOut: "05:03 PM" },
status: "regular", // amIn is missing!
}
]);
const handleAdjustment = (date: string, slotKey: string) => {
const timePrompt = prompt(`Enter correct time for ${slotKey} on ${date}:`, "08:00 AM");
if (!timePrompt) return;
setLogs((prev) =>
prev.map((log) =>
log.date === date
? { ...log, punches: { ...log.punches, [slotKey]: timePrompt } }
: log
)
);
};
return (
<DailyTimeRecord
employeeId="2026-1082"
employeeName="Nehry Dedoro"
department="MICTO"
position="Information Systems Analyst II"
month="October 2026"
schedule={SCHEDULE_STANDARD}
logs={logs}
onFileAdjustment={handleAdjustment}
/>
);
}DailyTimeRecord API Reference
Configure the daily time record component using the following options.
| Prop | Type | Default | Description |
|---|---|---|---|
| employeeId | string | The unique local identification ID of the employee. | |
| employeeName | string | The full display name of the employee. | |
| department | string | The municipal office/department (e.g. 'MICTO'). | |
| position | string | The official job title/position. | |
| month | string | The target calendar month string (e.g. 'October 2026'). | |
| schedule | ScheduleConfig | The employee's shift schedule configuration. Defines the dynamic punch slot columns, expected times, and daily hours. Use a preset (SCHEDULE_STANDARD, SCHEDULE_STRAIGHT, SCHEDULE_NIGHT) or build from backend data. | |
| logs | DtrLogEntry[] | [] | An array of daily time records. Each entry has a date, a punches map (keys match ScheduleSlot.key), overtime, and status. |
| onFileAdjustment | (date: string, slotKey: string) => void | undefined | Optional callback fired when a user clicks the adjustment trigger on missing or editable log cells. The slotKey matches the schedule slot. |
| onSaveAdjustment | (date: string, slotKey: string, correctedTime: string, reason: string, notes: string) => void | Promise<void> | undefined | Optional callback for the built-in adjustment sheet. Receives the corrected time in 12h format, reason category, and justification notes. |