refactor: rename formatDuration to formatDisplayTime

Renames the time formatting utility to be more generic since it's used for
both duration and currentTime display:
- Add formatDisplayTime as the primary function name
- Update all component references to use formatDisplayTime
- Keep formatDuration as deprecated alias for backward compatibility
- More semantic naming that reflects actual usage across components

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Christian Pillsbury
2025-09-12 15:59:15 -07:00
committed by Christian Pillsbury
co-authored by Claude
parent 5bd0a154db
commit 0746d400af
3 changed files with 24 additions and 13 deletions
@@ -3,7 +3,7 @@ import {
StateHook,
PropsHook,
} from '../utils/component-factory';
import { durationDisplayStateDefinition, formatDuration } from '@vjs-10/media-store';
import { durationDisplayStateDefinition, formatDisplayTime } from '@vjs-10/media-store';
import { namedNodeMapToObject } from '../utils/element-utils.js';
export function getTemplateHTML(
@@ -57,7 +57,7 @@ export class DurationDisplayBase extends HTMLElement {
// Update the span content with formatted duration
const spanElement = this.shadowRoot?.querySelector('span') as HTMLElement;
if (spanElement) {
spanElement.textContent = formatDuration(state.duration);
spanElement.textContent = formatDisplayTime(state.duration);
}
}
}