Browse Source

unused functions removed

pull/22619/head
erdemcaygor 2 years ago
parent
commit
f1913796de
  1. 3
      npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts
  2. 13
      npm/ng-packs/packages/core/src/lib/services/timezone.service.ts

3
npm/ng-packs/packages/core/src/lib/interceptors/timezone.interceptor.ts

@ -10,6 +10,9 @@ export class TimezoneInterceptor implements HttpInterceptor {
protected readonly timezoneService = inject(TimezoneService);
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
if (!this.timezoneService.isUtcClockEnabled) {
return next.handle(req);
}
const timezone = this.timezoneService.timezone;
if (timezone) {
req = req.clone({

13
npm/ng-packs/packages/core/src/lib/services/timezone.service.ts

@ -37,17 +37,4 @@ export class TimezoneService {
this.document.cookie = `${this.cookieKey}=${timezone}; path=/`;
}
}
convertUtcToLocal(date: string | Date): Date {
return new Date(date + 'Z');
}
convertLocalToUtc(date: Date): string {
return date.toISOString();
}
private getCookie(name: string): string | null {
const match = this.document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
return match ? decodeURIComponent(match[2]) : null;
}
}

Loading…
Cancel
Save