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

Feature Request: Allow custom coerceDateProperty strategy #7286

Closed
paulussup opened this issue Sep 25, 2017 · 1 comment · Fixed by #7346
Closed

Feature Request: Allow custom coerceDateProperty strategy #7286

paulussup opened this issue Sep 25, 2017 · 1 comment · Fixed by #7346
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix P4 A relatively minor issue that is not relevant to core functions

Comments

@paulussup
Copy link

paulussup commented Sep 25, 2017

https://github.com/angular/material2/blob/d2ceb2c755e20252f02fda11dc4eef55d20f4bbe/src/lib/datepicker/datepicker-input.ts#L37

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Ability to inject custom date coercion function or have numbers coerced as Unix Timestamps.

What is the current behavior?

Currrently strings are parsed as Iso8601 https://github.com/angular/material2/blob/d2ceb2c755e20252f02fda11dc4eef55d20f4bbe/src/lib/datepicker/coerce-date-property.ts#L23
and type == 'number' throw errors

https://github.com/angular/material2/blob/d2ceb2c755e20252f02fda11dc4eef55d20f4bbe/src/lib/datepicker/coerce-date-property.ts#L33

What are the steps to reproduce?

plunkr

What is the use-case or motivation for changing an existing behavior?

Numbers should be coerced as Unix Timestamps.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Is there anything else we should know?

@josephperrott josephperrott added feature This issue represents a new feature or feature request rather than a bug or bug fix P5 The team acknowledges the request but does not plan to address it, it remains open for discussion labels Sep 25, 2017
@josephperrott josephperrott changed the title Unable to implement own coerceDateProperty strategy. Feature Request: Allow custom coerceDateProperty strategy Sep 25, 2017
@josephperrott josephperrott added P4 A relatively minor issue that is not relevant to core functions and removed P5 The team acknowledges the request but does not plan to address it, it remains open for discussion labels Sep 25, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
2 participants