components icon indicating copy to clipboard operation
components copied to clipboard

How to display dates only in angular material date-picker?

Open ConClavi opened this issue 8 years ago • 2 comments

Bug:

What is the expected behavior?

For displaying Dates Only, Timezone calculation should be ignored!

What is the current behavior?

The issue here is that I want to display a date only, like date of birth, where the timezone is not important. my API serializes the date in iso_8601 format. The date picker keeps displaying the date one day before because it lacks the timezone. what is the work around here, Is there a way to force the date-picker to ignore the timezone or I have to change my API date output?

i.e,

API output,

{
 "aliasName": null,
 "patientDob": "1985-04-24",
 "contactAddress": null,
 "streetNo": null,
 }

Date-picker display as 4/23/1985, // I am using DateAdapter to display the date according to the locale.

If I reselect the date again, my Date-picker selected date value looks like, "1985-04-24T08:00:00.000Z"

What are the steps to reproduce?

Example here

ConClavi avatar Jun 11 '18 05:06 ConClavi

Please keep GitHub issues for bug reports / feature requests. Better avenues for troubleshooting / questions / requests for support are stack overflow, gitter, mailing list, etc.

(this is a canned response)

jelbourn avatar Jun 11 '18 22:06 jelbourn

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.