I can get this to work for Date fields, but if I'm making a date range, it won't be an option to use with it.

Comments

eahonet created an issue. See original summary.

prashant.c’s picture

@eahonet

Thanks for raising this issue. It would be great to have this feature in this module.

I will try to work on the same but any patches are also welcome.

Cheers!!

Kavya_akhil’s picture

StatusFileSize
new11.46 KB

@eahonet, @prashantc,

Here is the patch which has BootstrapDateRangeWidget plugin added.

Kavya_akhil’s picture

Status: Active » Needs review
davemybes’s picture

Status: Needs review » Reviewed & tested by the community

Just stumbled across this today and gave it a go. Works well for me and composer had no issue applying the patch. Nice work!

The only issue was that my default values for date and time (set via a form_alter) got overwritten. Not sure if that's something specific to this patch, or the module in general.

JThan’s picture

I get the following error after installen the patch via composer and choosing the bootstrap datepciker for a daterange date field.

Still investigating what this could be.

EDIT: To solve this i had to put the following line:
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;

into:

/bootstrap_datetime_picker/src/Plugin/Field/FieldWidget/BootstrapDateRangeWidget.php

ERROR:

Error: Class 'Drupal\bootstrap_datetime\Plugin\Field\FieldWidget\DateTimeItem' not found in Drupal\bootstrap_datetime\Plugin\Field\FieldWidget\BootstrapDateRangeWidget->formElement() (Zeile 273 in /home/dev/domains/[localdevdomain]/compdrup/web/modules/contrib/bootstrap_datetime_picker/src/Plugin/Field/FieldWidget/BootstrapDateRangeWidget.php)
JThan’s picture

StatusFileSize
new694 bytes

I added my change in an additional patch, whch you have to add after you added the patch from comment 3.

JThan’s picture

StatusFileSize
new11.52 KB

And here I combined both patches. Hope this works.

JThan’s picture

Status: Reviewed & tested by the community » Needs review
JThan’s picture

JThan’s picture

StatusFileSize
new11.51 KB

  • Prashant.c committed 2f91787 on 8.x-1.x authored by JThan
    Issue #3045190 by JThan, Kavya_akhil: Would be helpful if this...
prashant.c’s picture

Status: Needs review » Fixed

Thanks to all the contributors for your efforts. It is a very good feature to be added to this module.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.