-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
1,156 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [nifty-tou](./nifty-tou.md) > [ChronoField](./nifty-tou.chronofield.md) | ||
|
||
## ChronoField enum | ||
|
||
An enumeration of supported chronological fields of the Gregorian calendar. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare enum ChronoField | ||
``` | ||
|
||
## Enumeration Members | ||
|
||
| Member | Value | Description | | ||
| --- | --- | --- | | ||
| DAY\_OF\_WEEK | <code>2</code> | The day of the week, from Monday (1) to Sunday (7). | | ||
| MONTH\_OF\_YEAR | <code>1</code> | The month of year, from January (1) to December (12). | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [nifty-tou](./nifty-tou.md) > [ChronoFieldParser](./nifty-tou.chronofieldparser.md) > [(constructor)](./nifty-tou.chronofieldparser._constructor_.md) | ||
|
||
## ChronoFieldParser.(constructor) | ||
|
||
Constructor. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
constructor(locale: string); | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| locale | string | the desired locale | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [nifty-tou](./nifty-tou.md) > [ChronoFieldParser](./nifty-tou.chronofieldparser.md) > [forLocale](./nifty-tou.chronofieldparser.forlocale.md) | ||
|
||
## ChronoFieldParser.forLocale() method | ||
|
||
Get a parser for a given locale. | ||
|
||
This method will instantiate and cache parsers, returning cached instances if already avaialble. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
static forLocale(locale: string): ChronoFieldParser; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| locale | string | the locale of the parser to get | | ||
|
||
**Returns:** | ||
|
||
[ChronoFieldParser](./nifty-tou.chronofieldparser.md) | ||
|
||
the parser | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [nifty-tou](./nifty-tou.md) > [ChronoFieldParser](./nifty-tou.chronofieldparser.md) > [locale](./nifty-tou.chronofieldparser.locale.md) | ||
|
||
## ChronoFieldParser.locale property | ||
|
||
Get the locale. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
get locale(): string; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [nifty-tou](./nifty-tou.md) > [ChronoFieldParser](./nifty-tou.chronofieldparser.md) | ||
|
||
## ChronoFieldParser class | ||
|
||
Class to parse locale-specific chronological field names of the Gregorian calendar. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare class ChronoFieldParser | ||
``` | ||
|
||
## Constructors | ||
|
||
| Constructor | Modifiers | Description | | ||
| --- | --- | --- | | ||
| [(constructor)(locale)](./nifty-tou.chronofieldparser._constructor_.md) | | Constructor. | | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | | ||
| --- | --- | --- | --- | | ||
| [locale](./nifty-tou.chronofieldparser.locale.md) | <code>readonly</code> | string | Get the locale. | | ||
|
||
## Methods | ||
|
||
| Method | Modifiers | Description | | ||
| --- | --- | --- | | ||
| [forLocale(locale)](./nifty-tou.chronofieldparser.forlocale.md) | <code>static</code> | <p>Get a parser for a given locale.</p><p>This method will instantiate and cache parsers, returning cached instances if already avaialble.</p> | | ||
| [parse(field, value)](./nifty-tou.chronofieldparser.parse.md) | | Parse a field value. | | ||
| [parseRange(field, value)](./nifty-tou.chronofieldparser.parserange.md) | | <p>Parse a chronological field range string.</p><p>A "range string" is a string formatted like <code>VALUE - VALUE</code>. Whitespace is ignored, and the <code>- VALUE</code> portion can be omitted for a singleton range. For example, in the <code>en-US</code> locale, <code>Jan-Dec</code> would be parsed as <code>[1..12]</code>.</p> | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [nifty-tou](./nifty-tou.md) > [ChronoFieldParser](./nifty-tou.chronofieldparser.md) > [parse](./nifty-tou.chronofieldparser.parse.md) | ||
|
||
## ChronoFieldParser.parse() method | ||
|
||
Parse a field value. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
parse(field: ChronoField, value: string): ChronoFieldValue; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| field | [ChronoField](./nifty-tou.chronofield.md) | the field to treat <code>val</code> as | | ||
| value | string | the field value to parse | | ||
|
||
**Returns:** | ||
|
||
[ChronoFieldValue](./nifty-tou.chronofieldvalue.md) | ||
|
||
the associated field value, or undefined if not found | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [nifty-tou](./nifty-tou.md) > [ChronoFieldParser](./nifty-tou.chronofieldparser.md) > [parseRange](./nifty-tou.chronofieldparser.parserange.md) | ||
|
||
## ChronoFieldParser.parseRange() method | ||
|
||
Parse a chronological field range string. | ||
|
||
A "range string" is a string formatted like `VALUE - VALUE`<!-- -->. Whitespace is ignored, and the `- VALUE` portion can be omitted for a singleton range. For example, in the `en-US` locale, `Jan-Dec` would be parsed as `[1..12]`<!-- -->. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
parseRange(field: ChronoField, value: string): IntRange; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| field | [ChronoField](./nifty-tou.chronofield.md) | the field to parse the range values as | | ||
| value | string | the range string to parse | | ||
|
||
**Returns:** | ||
|
||
[IntRange](./nifty-tou.intrange.md) | ||
|
||
the parsed range, or `undefined` if not parsable as a range | ||
|
||
## Example | ||
|
||
Here are some basic examples: | ||
|
||
```ts | ||
const p = ChronoFieldParser.forLocale('en-US'); | ||
p.parseRange(ChronoField.MONTH_OF_YEAR, 'Jan-Dec'); // [1..12] | ||
p.parseRange(ChronoField.MONTH_OF_YEAR, '4-6'); // [4..6] | ||
p.parseRange(ChronoField.DAY_OF_WEEK, 'Wednesday'); // [3..3] | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [nifty-tou](./nifty-tou.md) > [ChronoFieldValue](./nifty-tou.chronofieldvalue.md) > [(constructor)](./nifty-tou.chronofieldvalue._constructor_.md) | ||
|
||
## ChronoFieldValue.(constructor) | ||
|
||
Constructor. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
constructor(field: ChronoField, names: string[], value: number); | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| field | [ChronoField](./nifty-tou.chronofield.md) | the chronological field | | ||
| names | string\[\] | the value names, from longest to shortest | | ||
| value | number | the value | | ||
|
Oops, something went wrong.