question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Datepicker with typeable and mask options or as icon-button

See original GitHub issue

First of all: thank you for datepicker component. Got tired of using broken 3rd party datepickers.

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

Sometimes user needs to select dates between 1950-2050 quickly. Clicking through datepicker takes too many clicks, faster option is to type date manually.

Describe the solution you’d like

If there could be a prop to switch datepicker into typeable mode. User can type date manually, without clicking through datepicker. Masked input is also welcome. For example only digits in format DD.MM.YYYY are allowed. Dots can be auto-prefilled. Paste option.

Easier solution could be: add prop to display datepicker as an “icon button” without date display field. Then datepicker can be appended/prepended into input-group next to b-form-input. Logic of handling masking and typing is left to developer in this case.

<b-input-group>
  <b-form-input v-model="someDate" @change="maskValue"></b-form-input>
  <template v-slot:append>
    <b-datepicker v-model="someDate" icon-only /> // datepicker as icon (no date text)
  </template>
</b-input-group>

image Something similar done in “eonasdan bootstrap datepicker”: https://eonasdan.github.io/bootstrap-datetimepicker/

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
tmorehousecommented, Mar 5, 2020

We’ll see if we can make an “icon button” only option for both the <b-form-datepicker> and <b-form-timepicker> components, which could then be placed as needed (i.e. in an input group append/prepend)

0reactions
tmorehousecommented, Mar 9, 2020

We probably won’t add directly in an option for typing a date in, as there are so many formats (and locales) for date formats, and Date.parse(...) is notorious for being inconsistent across browsers (and also not supporting locale overrides).

But we will be making a “button” only version to allow users to provide their own input or other entry option.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change the icon in MUI DatePicker? - Stack Overflow
1 Answer 1 · Where did you find this info? I want to change OpenPickerButtonProps, but I don't know the syntax. · Also,...
Read more >
DesktopDatePicker API - MUI X
Name Type Default onChange * func renderInput * func acceptRegex RegExp /\dap/gi
Read more >
Difficulties setting a Date Picker control
Solved: I'm trying to set a date picker control which appears to be an Angular control, based on what I could find on...
Read more >
Datepicker - @material-ui/pickers component
It is recommended to use keyboard input with mask for a better desktop experience. Make sure that mask will be automatically generated from...
Read more >
DatePicker - Gestalt is Pinterest's design system
DatePicker is used when the user has to select a date or date range. ... Type. Default ... Limiting date options to a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found