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

Insufficient data for localization #121

Open
Enngage opened this issue Jan 19, 2019 · 0 comments
Open

Insufficient data for localization #121

Enngage opened this issue Jan 19, 2019 · 0 comments

Comments

@Enngage
Copy link

Enngage commented Jan 19, 2019

Hey,

I've been trying to add my own localization using the IDisplayPreference (btw this interface should be exported in public api as I have to import it from amazing-time-picker/src/app/atp-library/definitions), but I'm unable to do so because the function to format hours/minutes only gets a number (https://github.com/owsolutions/amazing-time-picker/blob/master/src/app/atp-library/preferences.ts#L7).

export const PersianPreference: IDisplayPreference = {
  hour: (x) => persian.format(x),
  minute: (x) => {
    let exp = persian.format(x);
    if (exp.length === 1) {
      exp = persian.format(0) + exp;
    }
    return exp;
  },
  separator: ':',
  period: (x) => x === 'AM' ? 'صبح' : 'عصر',
  clockHour: (x) => persian.format(x),
  clockMinute: (x) => persian.format(x),
  labels: {
    ok: 'تایید',
    cancel: 'لغو'
  }
};

To localize, I need to know if its AM or PM. Can you extend these callbacks please?

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

1 participant