Skip to content

Commit

Permalink
Merge pull request #5984 from IgniteUI/bpachilova/feat-5982-editorOpt…
Browse files Browse the repository at this point in the history
…ions-input

feat(*): update topics with new fr related to input formats
  • Loading branch information
kacheshmarova authored Oct 31, 2024
2 parents 434de29 + 4925107 commit 57016dc
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions en/components/date-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ The [`IgxDatePickerComponent`]({environment:angularApiUrl}/classes/igxdatepicker
A good thing to note is that the the Angular DatePicker Component in Ignite UI will always add a leading zero on the `date` and `month` portions if they were provided in a format that does not have it, e.g. `d/M/yy` becomes `dd/MM/yy`. This applies only during editing.

[`displayFormat`]({environment:angularApiUrl}/classes/igxdatepickercomponent.html#displayFormat) on the other hand uses Angular's [`DatePipe`](https://angular.io/api/common/DatePipe) and is used to format the picker's input when it is not focused. If no [`displayFormat`]({environment:angularApiUrl}/classes/igxdatepickercomponent.html#displayFormat) is provided, the picker will use the [`inputFormat`]({environment:angularApiUrl}/classes/igxdatepickercomponent.html#inputFormat) as its [`displayFormat`]({environment:angularApiUrl}/classes/igxdatepickercomponent.html#displayFormat).
Alternatively, if the [`inputFormat`]({environment:angularApiUrl}/classes/igxdatepickercomponent.html#inputFormat) property is not set, the input format will be inferred from the [`displayFormat`]({environment:angularApiUrl}/classes/igxdatepickercomponent.html#displayFormat) in case it can be parsed as containing numeric date-time parts only.

More information about these can be found in the [`IgxDateTimeEditor`](date-time-editor.md#examples) examples section.

Expand Down
2 changes: 2 additions & 0 deletions en/components/date-range-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ The `inputFormat` property accepts a constructed format string using characters
</igx-date-range-picker>
```

If the [`inputFormat`]({environment:angularApiUrl}/classes/igxdaterangepickercomponent.html#inputFormat) property is not set, the input format will be inferred from the [`displayFormat`]({environment:angularApiUrl}/classes/igxdaterangepickercomponent.html#displayFormat) in case it can be parsed as containing numeric date-time parts only.

>[!NOTE]
> The `IgxDateRangePicker` now supports IME input. When composition ends, the control converts the wide-character numbers to ASCII characters.
Expand Down
1 change: 1 addition & 0 deletions en/components/date-time-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ Date Time Editor Directive has intuitive keyboard navigation that makes it easy
The [`IgxDateTimeEditor`]({environment:angularApiUrl}/classes/igxdatetimeeditordirective.html) supports different display and input formats.

It uses Angular's [`DatePipe`](https://angular.io/api/common/DatePipe), which allows it to support predefined format options, such as `shortDate` and `longDate`. It can also accept a constructed format string using characters supported by the `DatePipe`, e.g. `EE/MM/yyyy`. Notice that formats like `shortDate`, `longDate`, etc., can be used as [`displayFormat`]({environment:angularApiUrl}/classes/igxdatetimeeditordirective.html#displayFormat) only. Also, if no [`displayFormat`]({environment:angularApiUrl}/classes/igxdatetimeeditordirective.html#displayFormat) is provided, the editor will use the [`inputFormat`]({environment:angularApiUrl}/classes/igxdatetimeeditordirective.html#inputformat) as its [`displayFormat`]({environment:angularApiUrl}/classes/igxdatetimeeditordirective.html#displayFormat).
Alternatively, if the [`inputFormat`]({environment:angularApiUrl}/classes/igxdatetimeeditordirective.html#inputFormat) property is not set, the input format will be inferred from the [`displayFormat`]({environment:angularApiUrl}/classes/igxdatetimeeditordirective.html#displayFormat) in case it can be parsed as containing numeric date-time parts only.

To set a specific input format, pass it as a string to the IgxDateTimeEditor directive. This will set both the expected user input format and the [mask](mask.md) for the editor. Additionally, the [`inputFormat`]({environment:angularApiUrl}/classes/igxdatetimeeditordirective.html#inputFormat) is locale based, so if none is provided, the editor will default to the one used by the browser.

Expand Down
18 changes: 18 additions & 0 deletions en/components/grids_templates/editing.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,24 @@ In the @@igComponent if you set rowEditable property to true, and editable prope

All available column data types could be found in the official [Column types topic](column-types.md#default-template).

#### Default template editors of date-time columns

The template editors of `date`, `dateTime` and `time` column data types use a default input format as per the `IgxGrid`'s [`locale`]({environment:angularApiUrl}/classes/igxgridcomponent.html#locale).

In case the [`pipeArgs`]({environment:angularApiUrl}/interfaces/columntype.html#pipeArgs) object `format` property is set on the column, the input format of the editors will be inferred from it. The condition is that it can be parsed as containing numeric date-time parts only.

If the editors input format should be explicitly set, the [`editorOptions`]({environment:angularApiUrl}/interfaces/columntype.html#editorOptions) object of type [`IColumnEditorOptions`]({environment:angularApiUrl}/interfaces/icolumneditoroptions.html) can be leveraged. It accepts a `dateTimeFormat` property that is used as input format for the editors of `date`, `dateTime` and `time` column data types.

```typescript
const editorOptions: IColumnEditorOptions = {
dateTimeFormat: 'MM/dd/YYYY',
}
```

```html
<igx-column field="sampleDate" dataType="date" [editorOptions]="editorOptions"></igx-column>
```

### Event arguments and sequence
The grid exposes a wide array of events that provide greater control over the editing experience. These events are fired during the [**Row Editing**](row-editing.md) and [**Cell Editing**](cell-editing.md) lifecycle - when starting, committing or canceling the editing action.

Expand Down
1 change: 1 addition & 0 deletions en/components/time-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ The time picker component supports different display and input formats.
The display format is the format of the value when in edit mode and can be one of the listed Angular [DatePipe](https://angular.io/api/common/DatePipe) formats. This allows it to support predefined format options, such as `shortTime` and `longTime`.

The input format is the format of the value when not in edit mode and the format, in which the time portions are displayed in the dropdown/dialog. The `inputFormat` property accepts a constructed format string using characters supported by the DatePipe, e.g. `hh:mm:ss`, but doesn't support predefined format options, such as `shortTime` and `longTime`. If the `inputFormat` property is not defined, it defaults to `hh:mm tt`.
Alternatively, if the [`inputFormat`]({environment:angularApiUrl}/classes/igxtimepickercomponent.html#inputFormat) property is not set, the input format will be inferred from the [`displayFormat`]({environment:angularApiUrl}/classes/igxtimepickercomponent.html#displayFormat) in case it can be parsed as containing numeric date-time parts only.

```html
<igx-time-picker
Expand Down

0 comments on commit 57016dc

Please sign in to comment.