Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3924

How to display a datepicker on Symfony?

$
0
0

I want to set up a date-picker for my date type fields based on symfony documentation. I have installed the package since packagist 'eternicode / bootstrap-datepicker'. I am able to apply my defined conditions for entering the date field in my js (like the date format) but the display is still impossible. I do not have an error message in my js console. I don't even see the datepikcer component..

My Form Type:

   ->add('date_entree', DateType::class, [ 
                'widget' => 'single_text',
    'html5' => false,
    'attr' => ['class' => 'js-datepicker'],
                ])

My JS:

    $(document).on('ready', function() {
         $('.js-datepicker').datepicker({
              format: 'dd-mm-yyyy',
         });
     });

Have you please an idea about this issue?


Viewing all articles
Browse latest Browse all 3924

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>