Skip to content

Commit

Permalink
Add phone number service info
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusKjeldgaard committed Feb 5, 2025
1 parent 46e72bc commit 93a821f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions libs/extensions/angular/localization/src/formatting-pipes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ If you need the formatted value in your component code instead of in the templat
FormatNumberService.formatNumber(value: number, digitsInfo: string);
```

## Phone Number
<Description of={PhoneNumberStories.PhoneNumber} />
<Canvas of={PhoneNumberStories.PhoneNumber} />

If you need the formatted value in your component code instead of in the template, you can use the underlying service directly:

```ts
PhoneNumberService.formatPhoneNumber(phoneNumber: PhoneNumber | string, chunk?: number, showCountryCode?: boolean);
```


## Time & Date
### Time Only
<Description of={TimeOnlyStories.default} />
Expand All @@ -61,10 +72,6 @@ FormatNumberService.formatNumber(value: number, digitsInfo: string);
<Description of={TimeOrDateStories.default} />
<Canvas of={TimeOrDateStories.TimeOrDate} />

## Phone Number
<Description of={PhoneNumberStories.PhoneNumber} />
<Canvas of={PhoneNumberStories.PhoneNumber} />

## Setup

To set up the localization formatting pipes, you need to provide the necessary configuration token in the providers array of your module or component, or when bootstrapping your application. This configuration includes details such as the native currency, default language, country code, and time zone.
Expand Down

0 comments on commit 93a821f

Please sign in to comment.