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

Date/datetime/time editors should accept the same formats that the angular pipes accept #14011

Closed
ChronosSF opened this issue Mar 22, 2024 · 2 comments · Fixed by #14065
Closed
Assignees
Labels
🕐 time-picker 📅 date-picker 📅 date-time-editor 🧰 feature-request ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.

Comments

@ChronosSF
Copy link
Member

Is your feature request related to a problem? Please describe.

Currently if you want to set 12-hour date-time format using the Angular date formatting pipe you do something like this:

dd/MM/yyyy hh:mm:ss a

But our date-time editor that is supposed to seamlessly edit such cells need a format like this:

dd/MM/yyyy hh:mm:ss tt

Our editors should be able to understand formats that the default Angular pipes use as users shouldn't be required to set two different formats to achieve the same result between a cell in and out of edit mode.

@ddaribo
Copy link
Contributor

ddaribo commented Mar 27, 2024

Angular's DatePipe supports 19 field types, including the supported for editing by the Ingite UI for Angular date/time editors: Date, Month, Year, Hours, Minutes, Seconds, and Period (named AmPm in the library). Non-supported types include Era, Month standalone, etc, ref.

To extend support for additional custom formats, editors would need to handle the same features implemented for currently supported date parts, such as spin editing, masking and validation. This may introduce complexities in editing non-numeric date parts.

Currently, only the numeric equivalents of the DatePipe's formats are covered for input by the editors, excluding Fractional Seconds. Period (AmPm) is supported through the format tt, as in the given example above, but other variations like aaaa & aaaaa, etc. are not.

Regarding currency, percent, and number types columns in the igx-grid, their formats can be configured using the pipeArgs property and they support the same set of configs as the corresponding Angular pipes (ref) - for display. There is no formatting/mask applied for their edit mode as a result of configuring the pipeArgs whatsoever.

The options to enhance this could include:

  • Supporting Period format as a, aa, & aaa. Consideration for aaaa & aaaaa formats and Period* field types?
  • Adding support for editing Fractional Seconds, the only numeric field type currently unsupported, if it makes sense in the context of the date/time editors.

@kacheshmarova kacheshmarova added 🛠️ status: in-development Issues and PRs with active development on them and removed 👀 status: in-review Issue is currently being reviewed labels Mar 27, 2024
@rkaraivanov
Copy link
Member

I'm thumbs up for supporting the a, aa, etc. for the display format of the period in the date time editor.

As an aside, the web component version already does t, tt, ttt, tttt and ttttt as display format values, so if the Angular version does not support them, then we should consider adding that as well.

As for the fractional second, sure let's add that too. Open a new issue or link this one to the web component repository as these changes should be implemented there as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕐 time-picker 📅 date-picker 📅 date-time-editor 🧰 feature-request ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.
Projects
None yet
4 participants