ngx-material-timepicker icon indicating copy to clipboard operation
ngx-material-timepicker copied to clipboard

Not working on Edge browser

Open TarnjeetIron opened this issue 2 years ago • 4 comments

I tried to use min and max value example (ngx-timepicker-field) but its not working on Edge browser on window platform. Its also not working for your demo in Edge browser. https://agranom.github.io/ngx-material-timepicker/

TarnjeetIron avatar Feb 11 '23 05:02 TarnjeetIron

Same issue for me, time picker is not working on edge but works fine in chrome

nikheelneelay avatar Feb 14 '23 07:02 nikheelneelay

This can be worked around (read: hacked) by not using the [ngxTimepicker] directive on the input you're displaying, and instead manually getting and processing the time. A hidden input such as <input [ngxTimepicker]="timePicker" hidden> is however necessary because without attaching the <ngx-material-timepicker ...> to an <input> component, 'PM' values were returning as 'AM'.

Example Implementation

your.component.html

<input [ngxTimepicker]="timePicker" hidden>
<input matInput [(ngModel)]="onlyTimeString" (click)="timePicker.open()" />
<ngx-material-timepicker #timePicker (timeSet)="timeSet($event)"
  [defaultTime]="onlyTimeString"></ngx-material-timepicker>

your.component.ts

  onlyTimeString: string;

  timeSet(time: string): void {
    this.onlyTimeString = time.replace(/\u202f/g, " ");
  }

For whatever reason, Edge returns a time with the character U+202f instead of a space between the time part and the AM/PM. U+202f looks like a space when output to the console, which was fun to diagnose...

jamesmikesell avatar Feb 17 '23 01:02 jamesmikesell

This can be worked around (read: hacked) by not using the [ngxTimepicker] directive on the input you're displaying, and instead manually getting and processing the time. A hidden input such as <input [ngxTimepicker]="timePicker" hidden> is however necessary because without attaching the <ngx-material-timepicker ...> to an <input> component, 'PM' values were returning as 'AM'.

Example Implementation

your.component.html

<input [ngxTimepicker]="timePicker" hidden>
<input matInput [(ngModel)]="onlyTimeString" (click)="timePicker.open()" />
<ngx-material-timepicker #timePicker (timeSet)="timeSet($event)"
  [defaultTime]="onlyTimeString"></ngx-material-timepicker>

your.component.ts

  onlyTimeString: string;

  timeSet(time: string): void {
    this.onlyTimeString = time.replace(/\u202f/g, " ");
  }

For whatever reason, Edge returns a time with the character U+202f instead of a space between the time part and the AM/PM. U+202f looks like a space when output to the console, which was fun to diagnose...

it's working fine for me

agiratech-nikkel avatar Feb 17 '23 11:02 agiratech-nikkel

Can you check it with the new version? It should be fixed

Agranom avatar Jun 08 '23 11:06 Agranom