You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have tried implementing referring to the code snippet in - #130 (comment)
We need to inject a service in the CustomDateTimePicker class. Since we extend NativeDateTimeAdapter class it throws error while we inject owlDateTimeLocale which is a private string variable.
Could you please provide details on what is the right approach to use custom Date time picker?
The one mentioned below does not work
https://danielykpan.github.io/date-time-picker/#locale-formats
We have tried implementing referring to the code snippet in - #130 (comment)
We need to inject a service in the CustomDateTimePicker class. Since we extend NativeDateTimeAdapter class it throws error while we inject owlDateTimeLocale which is a private string variable.
custom-date-time-format.ts
@Injectable({providedIn: 'root'})
export class CustomDateTimeAdapter extends NativeDateTimeAdapter {
constructor(
owlDateTimeLocale: string,
platform: Platform,
private readonly languageDetail: LanguageDetailService
) {
super(owlDateTimeLocale, platform)
}
format(date: Date, format): string {
if (!this.isValid(date)) {
throw Error('JSNativeDate: Cannot format invalid date.');
}
return ('0' + date.getDate()).slice(-2) + '.' + ('0' + (date.getMonth() + 1)).slice(-2) + '.' + date.getFullYear();
}
Angular version used: 14.1.0
The text was updated successfully, but these errors were encountered: