Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working on Edge browser #424

Open
TarnjeetIron opened this issue Feb 11, 2023 · 4 comments
Open

Not working on Edge browser #424

TarnjeetIron opened this issue Feb 11, 2023 · 4 comments

Comments

@TarnjeetIron
Copy link

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/

@nikheelneelay
Copy link

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

@jamesmikesell
Copy link

jamesmikesell commented Feb 17, 2023

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...

@agiratech-nikkel
Copy link

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

@Agranom
Copy link
Owner

Agranom commented Jun 8, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants