components icon indicating copy to clipboard operation
components copied to clipboard

DatePicker Feature Request: "Today" button

Open zelias500 opened this issue 8 years ago • 11 comments

Bug, feature request, or proposal:

Feature request

What is the expected behavior?

Add a configurable "Today" button to the DatePicker that automatically sets today's date as the value for the form field

What is the current behavior?

Users commonly scroll to different years/months/etc using the DatePicker and get stuck very far away from where they'd like to be. Like any complex, menu-centric navigation user interface, there should be an easy way to jump directly back to where you started.

What are the steps to reproduce?

n/a -- feature request

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

This is a UX improvement. Allowing users to easily jump to "Today" via a button press allows them to "start over" super easily from wherever they may have ended up navigating through the DatePicker rabbit hole. Additionally, it makes it easy for users to jump to a date that constantly changes, but is commonly selected on that given day, making their experience just that much better.

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

n/a -- feature request

Is there anything else we should know?

Should include i18n + a11y support, but that's always easier said than done.

zelias500 avatar Jun 11 '18 21:06 zelias500

Seems to be a decent feature addition, but a developer can always add this feature, depending on the requirements. Because, integrating more and more options to a component will result in hard-coupling, thereby making the overall component unnecessarily bulky.

Ideally, a component should serve the purpose of general reusable piece of code, with bare-minimum features. Now, if any developer need some additional feature which doesn't require fundamental changes to the component's API, then it must be added on top of it.

sahilbabbar avatar Jun 12 '18 05:06 sahilbabbar

+1

rafawalter avatar Nov 06 '18 12:11 rafawalter

@zelias500 fancy meeting you here

crimsonsunset avatar Dec 31 '18 21:12 crimsonsunset

Is there a piece of code to start with on how to add a today button to the header of the datepicker?

sijabbour avatar Mar 27 '19 14:03 sijabbour

+1

wbeeftink avatar Apr 01 '19 10:04 wbeeftink

+1

philipschikora avatar Apr 25 '19 14:04 philipschikora

+1

Pradeep12191 avatar May 18 '19 07:05 Pradeep12191

+1

MaximBelov avatar May 28 '19 12:05 MaximBelov

+1

L-U-C-K-Y avatar Nov 20 '19 16:11 L-U-C-K-Y

This functionality is not in the Material Design spec (https://material.io/components/date-pickers) so it is out of scope for Angular Material but you can add a custom header. https://stackblitz.com/angular/jxrdygrqknj?file=src%2Fapp%2Fdatepicker-custom-header-example.ts

annieyw avatar Mar 29 '21 21:03 annieyw

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.