Skip to content

Commit 6220be9

Browse files
dmihaylotsvetomir
authored andcommitted
docs: include links to angular date and number formatting and parsing
1 parent ab40f38 commit 6220be9

File tree

2 files changed

+42
-22
lines changed

2 files changed

+42
-22
lines changed

src/dates.d.ts

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { DateFormatNameOptions } from './cldr';
22

33
/**
44
* Settings for the `formatDate` and `parseDate` functions.
5+
* {% platform_content angular %}
6+
* For a runnable example, refer to the article on
7+
* [date and number formatting and parsing]({% parsingandformatting_intl %}#toc-date-formatting).
8+
* {% endplatform_content %}
59
*/
610
export interface DateFormatOptions {
711
/**
@@ -16,74 +20,77 @@ export interface DateFormatOptions {
1620
pattern?: string;
1721

1822
/**
19-
* Specifies which of the locale `dateFormats` should be used to format the value.
23+
* Specifies which of the locale `dateFormats` will be used to format the value.
2024
*/
2125
date?: 'short' | 'medium' | 'long' | 'full';
2226

2327
/**
24-
* Specifies which of the locale `timeFormats` should be used to format the value.
28+
* Specifies which of the locale `timeFormats` will be used to format the value.
2529
*/
2630
time?: 'short' | 'medium' | 'long' | 'full';
2731

2832
/**
29-
* Specifies which of the locale `dateTimeFormats` should be used to format the value.
33+
* Specifies which of the locale `dateTimeFormats` will be used to format the value.
3034
*/
3135
datetime?: 'short' | 'medium' | 'long' | 'full';
3236

3337
/**
34-
* Specifies how the date era should be formatted.
38+
* Specifies how the date era will be formatted.
3539
*/
3640
era?: 'narrow' | 'short' | 'long';
3741

3842
/**
39-
* Specifies how the date year should be formatted.
43+
* Specifies how the date year will be formatted.
4044
*/
4145
year?: 'numeric' | '2-digit';
4246

4347
/**
44-
* Specifies how the date month should be formatted.
48+
* Specifies how the date month will be formatted.
4549
*/
4650
month?: 'numeric' | '2-digit' | 'narrow' | 'short' | 'long';
4751

4852
/**
49-
* Specifies how the day of the month should be formatted.
53+
* Specifies how the day of the month will be formatted.
5054
*/
5155
day?: 'numeric' | '2-digit';
5256

5357
/**
54-
* Specifies how the day of the week should be formatted.
58+
* Specifies how the day of the week will be formatted.
5559
*/
5660
weekday?: 'narrow' | 'short' | 'long';
5761

5862
/**
59-
* Specifies how the hours should be formatted.
63+
* Specifies how the hours will be formatted.
6064
*/
6165
hour?: 'numeric' | '2-digit';
6266

6367
/**
64-
* Specifies whether a 12-hour time-set should be used for the formatting.
68+
* Specifies whether a 12-hour time-set will be used for the formatting.
6569
*/
6670
hour12?: boolean;
6771

6872
/**
69-
* Specifies how the minutes should be formatted.
73+
* Specifies how the minutes will be formatted.
7074
*/
7175
minute?: 'numeric' | '2-digit';
7276

7377
/**
74-
* Specifies how the seconds should be formatted.
78+
* Specifies how the seconds will be formatted.
7579
*/
7680
second?: 'numeric' | '2-digit';
7781

7882
/**
79-
* Specifies how the time-zone should be formatted.
83+
* Specifies how the time-zone will be formatted.
8084
*/
8185
timeZoneName?: 'short' | 'long';
8286
}
8387

8488
/**
85-
* Converts a `Date` object into a string based on the specified format and locale
86-
* ([see example](https://github.com/telerik/kendo-intl/blob/master/docs/date-formatting/index.md).
89+
* Converts a `Date` object into a string based on the specified format and locale.
90+
* {% platform_content angular %}
91+
* For a runnable example, refer to the article on
92+
* [date and number formatting and parsing]({% parsingandformatting_intl %}#toc-date-formatting).
93+
* {% endplatform_content %}
8794
*
8895
* @param value - Defines the date that will be formatted.
8996
* @param format - Defines a string that represents a predefined or custom date format, or a configuration object.
@@ -94,10 +101,13 @@ export function formatDate(value: Date, format: string|DateFormatOptions, locale
94101

95102
/**
96103
* Converts a string into a `Date` object based on the specified format and locale
97-
* ([see example](https://github.com/telerik/kendo-intl/blob/master/docs/date-parsing/index.md).
104+
* {% platform_content angular %}
105+
* For a runnable example, refer to the article on
106+
* [date and number formatting and parsing]({% parsingandformatting_intl %}#toc-date-parsing).
107+
* {% endplatform_content %}
98108
*
99109
* @param value - Defines the string that will be parsed.
100-
* @param format - Defines a string that represents a predefined or custom date format, a configuration object, or an array of formats that should be used to parse the value.
110+
* @param format - Defines a string that represents a predefined or custom date format, a configuration object, or an array of formats that will be used to parse the value.
101111
* @param locale - The optional locale `id`. If not specified, the `id` of the `"en"` locale is used.
102112
* @returns - The parsed date.
103113
*/
@@ -123,7 +133,7 @@ export interface DateFormatPart {
123133
names?: DateFormatNameOptions;
124134

125135
/**
126-
* Specifies whether a 12-hour time-set should be used for the formatting.
136+
* Specifies whether a 12-hour time-set will be used for the formatting.
127137
*/
128138
hour12?: boolean;
129139
}

src/numbers.d.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
/**
22
* Settings for the `formatNumber` and `parseNumber` functions.
3+
* {% platform_content angular %}
4+
* For a runnable example, refer to the article on
5+
* [date and number formatting and parsing]({% parsingandformatting_intl %}#toc-number-formatting).
6+
* {% endplatform_content %}
37
*/
48
export interface NumberFormatOptions {
59

@@ -48,8 +52,11 @@ export interface NumberFormatOptions {
4852
}
4953

5054
/**
51-
* Converts a string into a `Number` based on the specified locale
52-
* (https://github.com/telerik/kendo-intl/blob/master/docs/num-parsing/index.md).
55+
* Converts a string into a `Number` based on the specified locale.
56+
* {% platform_content angular %}
57+
* For a runnable example, refer to the article on
58+
* [date and number formatting and parsing]({% parsingandformatting_intl %}#toc-number-parsing).
59+
* {% endplatform_content %}
5360
*
5461
* @param value - The string that will be parsed.
5562
* @param locale - The locale `id` that defines the locale whose information should be used to parse the string.
@@ -59,8 +66,11 @@ export interface NumberFormatOptions {
5966
export function parseNumber(value: string, locale?: string, format?: string|NumberFormatOptions): number;
6067

6168
/**
62-
* Converts a `Number` into a string based on the specified format and locale
63-
* (https://github.com/telerik/kendo-intl/blob/master/docs/num-formatting/index.md).
69+
* Converts a `Number` into a string based on the specified format and locale.
70+
* {% platform_content angular %}
71+
* For a runnable example, refer to the article on
72+
* [date and number formatting and parsing]({% parsingandformatting_intl %}#toc-number-formatting).
73+
* {% endplatform_content %}
6474
*
6575
* @param value - The number that will be formatted.
6676
* @param format - The format that will be applied.

0 commit comments

Comments
 (0)