3

I am noticing that the Date field type only has the availability of three widgets:

  1. Select list
  2. Date and time
  3. Select list, no time

Can someone tell me why the "Text Field" widget is gone? Or am I missing something?

I have a use case where the user needs to be able to copy the date from another source and paste that value into the date field. It would be too time-consuming to have to pick the date from a "date picker" widget. It would be ok if it were a one-off situation but this user needs to be able to enter several at a time.

2
  • See Change the date format for the form display at the time you could still paste with Firefox, not sure if that's still the case.
    – No Sssweat
    Sep 27 '20 at 4:58
  • Thank You @NoSssweat ! ! I am using Firefox and yes I can't paste with it. I followed your post on drupal.org. Do you know of a module that creates the new field formatter/input widget?
    – tawellman
    Sep 27 '20 at 5:31
4

I have a use case where the user needs to be able to copy the date from another source and paste that value into the date field.

Bootstrap Datepicker

This will allow you to type/paste in and change the date format.

enter image description here

Note: composer won't install the library for you, you have to manually get the /dist folder from github and put in in the /libraries folder. So it has the /libraries/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js structure.


Similar but don't quite do it

Datetime Flatpickr Allows you to change date format, but doesn't allow you to type/paste in.

Bootstrap DateTime Picker Allows you to type/paste in, but doesn't allow changing the date format.

Single Date Time Picker doesn't allow you to type/paste in nor change the time format.

2
  • Thank You for your quick response!! But I found It won't install via Composer. Throws a "Your requirements could not be resolved to an installable set of packages." error. I also tried the Bootstrap DateTime Picker and wasn't able to install it either on 9.
    – tawellman
    Sep 27 '20 at 13:24
  • @tawellman yes, because both of these modules are not D9 ready. See Require v8 only contrib module with v9 patch for ways to get around that. Also, if you go with Bootstrap Datepicker you will need to apply D9 compatibility patch
    – No Sssweat
    Sep 27 '20 at 22:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.