MCPcopy Create free account
hub / github.com/angular/angular / formatDateForInput

Function formatDateForInput

packages/forms/signals/src/directive/native.ts:193–202  ·  view source on GitHub ↗
(date: Date, type: 'date' | 'month')

Source from the content-addressed store, hash-verified

191}
192
193function formatDateForInput(date: Date, type: 'date' | 'month'): string {
194 const year = date.getUTCFullYear();
195 const month = String(date.getUTCMonth() + 1).padStart(2, '0');
196
197 if (type === 'month') {
198 return `${year}-${month}`;
199 }
200 const day = String(date.getUTCDate()).padStart(2, '0');
201 return `${year}-${month}-${day}`;
202}
203
204export function formatDateForMinMax(name: string, value: unknown, type: string): unknown {
205 if (

Callers 1

formatDateForMinMaxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected