adapts time format
This commit is contained in:
@@ -5,6 +5,7 @@ import { ProjectColorDot } from "@/components/ProjectColorDot";
|
|||||||
import { StatCard } from "@/components/StatCard";
|
import { StatCard } from "@/components/StatCard";
|
||||||
import {
|
import {
|
||||||
formatDate,
|
formatDate,
|
||||||
|
formatTime,
|
||||||
formatDurationFromDatesHoursMinutes,
|
formatDurationFromDatesHoursMinutes,
|
||||||
formatDurationHoursMinutes,
|
formatDurationHoursMinutes,
|
||||||
calculateDuration,
|
calculateDuration,
|
||||||
@@ -121,7 +122,8 @@ export function DashboardPage() {
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-4 py-3 whitespace-nowrap text-sm text-gray-500">
|
<td className="px-4 py-3 whitespace-nowrap text-sm text-gray-500">
|
||||||
{formatDate(entry.startTime)}
|
<div>{formatDate(entry.startTime)}</div>
|
||||||
|
<div className="text-xs text-gray-400">{formatTime(entry.startTime)} – {formatTime(entry.endTime)}</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-4 py-3 whitespace-nowrap text-sm text-gray-900 font-mono">
|
<td className="px-4 py-3 whitespace-nowrap text-sm text-gray-900 font-mono">
|
||||||
{formatDurationFromDatesHoursMinutes(entry.startTime, entry.endTime)}
|
{formatDurationFromDatesHoursMinutes(entry.startTime, entry.endTime)}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { useProjects } from '@/hooks/useProjects';
|
|||||||
import { Modal } from '@/components/Modal';
|
import { Modal } from '@/components/Modal';
|
||||||
import { Spinner } from '@/components/Spinner';
|
import { Spinner } from '@/components/Spinner';
|
||||||
import { ProjectColorDot } from '@/components/ProjectColorDot';
|
import { ProjectColorDot } from '@/components/ProjectColorDot';
|
||||||
import { formatDate, formatDurationFromDatesHoursMinutes, getLocalISOString, toISOTimezone } from '@/utils/dateUtils';
|
import { formatDate, formatTime, formatDurationFromDatesHoursMinutes, getLocalISOString, toISOTimezone } from '@/utils/dateUtils';
|
||||||
import type { TimeEntry, CreateTimeEntryInput, UpdateTimeEntryInput } from '@/types';
|
import type { TimeEntry, CreateTimeEntryInput, UpdateTimeEntryInput } from '@/types';
|
||||||
|
|
||||||
export function TimeEntriesPage() {
|
export function TimeEntriesPage() {
|
||||||
@@ -117,7 +117,10 @@ export function TimeEntriesPage() {
|
|||||||
<tbody className="bg-white divide-y divide-gray-200">
|
<tbody className="bg-white divide-y divide-gray-200">
|
||||||
{data?.entries.map((entry) => (
|
{data?.entries.map((entry) => (
|
||||||
<tr key={entry.id} className="hover:bg-gray-50">
|
<tr key={entry.id} className="hover:bg-gray-50">
|
||||||
<td className="px-4 py-3 whitespace-nowrap text-sm text-gray-900">{formatDate(entry.startTime)}</td>
|
<td className="px-4 py-3 whitespace-nowrap text-sm text-gray-900">
|
||||||
|
<div>{formatDate(entry.startTime)}</div>
|
||||||
|
<div className="text-xs text-gray-400">{formatTime(entry.startTime)} – {formatTime(entry.endTime)}</div>
|
||||||
|
</td>
|
||||||
<td className="px-4 py-3 whitespace-nowrap">
|
<td className="px-4 py-3 whitespace-nowrap">
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<ProjectColorDot color={entry.project.color} />
|
<ProjectColorDot color={entry.project.color} />
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export function formatDate(date: string | Date): string {
|
|||||||
|
|
||||||
export function formatTime(date: string | Date): string {
|
export function formatTime(date: string | Date): string {
|
||||||
const d = typeof date === "string" ? parseISO(date) : date;
|
const d = typeof date === "string" ? parseISO(date) : date;
|
||||||
return format(d, "h:mm a");
|
return format(d, "HH:mm");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function formatDateTime(date: string | Date): string {
|
export function formatDateTime(date: string | Date): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user