{"record":{"id":"8d1d1cbc0fd275a0","repo":"angular/components","slug":"not-implemented","errorCode":null,"errorMessage":"NOT_IMPLEMENTED","messagePattern":"NOT_IMPLEMENTED","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/material/core/datetime/date-adapter.ts","lineNumber":203,"sourceCode":"   * @returns Whether the date is valid.\n   */\n  abstract isValid(date: D): boolean;\n\n  /**\n   * Gets date instance that is not valid.\n   * @returns An invalid date.\n   */\n  abstract invalid(): D;\n\n  /**\n   * Sets the time of one date to the time of another.\n   * @param target Date whose time will be set.\n   * @param hours New hours to set on the date object.\n   * @param minutes New minutes to set on the date object.\n   * @param seconds New seconds to set on the date object.\n   */\n  setTime(target: D, hours: number, minutes: number, seconds: number): D {\n    throw new Error(NOT_IMPLEMENTED);\n  }\n\n  /**\n   * Gets the hours component of the given date.\n   * @param date The date to extract the hours from.\n   */\n  getHours(date: D): number {\n    throw new Error(NOT_IMPLEMENTED);\n  }\n\n  /**\n   * Gets the minutes component of the given date.\n   * @param date The date to extract the minutes from.\n   */\n  getMinutes(date: D): number {\n    throw new Error(NOT_IMPLEMENTED);\n  }\n","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/angular/components/blob/0411926e7d8ae06b32236ec1048a888cfad5abf2/src/material/core/datetime/date-adapter.ts#L185-L221","documentation":"DateAdapter is an abstract base; setTime is an optional time-related method that the base implementation deliberately throws NOT_IMPLEMENTED. Only adapters for date types that support time (e.g. MomentDateAdapter, LuxonDateAdapter, or a native adapter subclass that overrides it) implement it. The stock NativeDateAdapter may not implement it unless the version does.","triggerScenarios":"Calling adapter.setTime(date, h, m, s) on a DateAdapter instance whose concrete class has not overridden setTime.","commonSituations":"Using a custom date adapter that only implements the required abstract methods but not the optional time methods; using a date implementation (e.g. year/month-only dates) that cannot represent time; calling time features (timepicker) with an adapter lacking time support.","solutions":["Use a date adapter that implements time support (e.g. MatMomentDateModule / MatLuxonDateModule) or upgrade to a version whose native adapter implements setTime","Override setTime in your custom DateAdapter subclass, returning a copy of target with the given time","Avoid calling time-based APIs if your date type cannot represent time"],"exampleFix":"// before\nclass MyAdapter extends DateAdapter<MyDate> { /* setTime not overridden */ }\nadapter.setTime(d, 10, 30, 0); // throws\n// after\nclass MyAdapter extends DateAdapter<MyDate> {\n  setTime(target: MyDate, hours: number, minutes: number, seconds: number): MyDate {\n    return {...target, hours, minutes, seconds};\n  }\n}","handlingStrategy":"type-guard","validationCode":"if (adapter.setTime === DateAdapter.prototype.setTime) {\n  throw new Error('This adapter does not support setTime');\n}","typeGuard":"function supportsTime<D>(a: DateAdapter<D>): a is DateAdapter<D> & Required<Pick<DateAdapter<D>, 'setTime'|'getHours'|'getMinutes'|'getSeconds'>> {\n  return a.setTime !== DateAdapter.prototype.setTime;\n}","tryCatchPattern":"try {\n  adapter.setTime(date, 10, 30, 0);\n} catch (e) {\n  if ((e as Error).message === 'NOT_IMPLEMENTED') {\n    // fall back to constructing the date manually or use a time-capable adapter\n  } else { throw e; }\n}","preventionTips":["Override setTime in custom DateAdapter subclasses","Use MatMomentDateModule/MatLuxonDateModule for time support","Feature-check (method !== base prototype) before calling optional adapter methods"],"tags":["angular","material","date-adapter","not-implemented","abstract-method"],"backgroundTag":"not-implemented","analyzedSha":"0411926e7d8ae06b32236ec1048a888cfad5abf2","analyzedAt":"2026-08-31T11:58:23.400Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}