fix(version): 修正概览耗时与排名统计
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { Priority } from './derive';
|
||||
import { calcWorkHours, type TimeInterval } from './work-hours';
|
||||
import { calcActualElapsedHours, type TimeInterval } from './work-hours';
|
||||
|
||||
export type BugStatus = 'open' | 'fixing' | 'fixed' | 'verifying' | 'closed' | 'rejected';
|
||||
export type BugSeverity = 'critical' | 'major' | 'minor' | 'trivial';
|
||||
@@ -32,6 +32,8 @@ export interface Bug {
|
||||
resolvedAt?: string;
|
||||
closedAt?: string;
|
||||
resolution?: string;
|
||||
estimateHours?: number;
|
||||
aiEstimateHours?: number;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
@@ -93,7 +95,7 @@ export function getBugActualHours(bug: Bug, now: Date = new Date()): number {
|
||||
const start = bug.createdAt;
|
||||
if (!start) return 0;
|
||||
const end = bug.closedAt ?? bug.resolvedAt ?? (bug.status === 'closed' || bug.status === 'rejected' ? bug.updatedAt : now.toISOString());
|
||||
return calcWorkHours(start, end);
|
||||
return calcActualElapsedHours(start, end);
|
||||
}
|
||||
|
||||
export function aggregateBugActualHours(bugs: Bug[], now: Date = new Date()): number {
|
||||
|
||||
Reference in New Issue
Block a user