django-bootstrap-datepicker-plus icon indicating copy to clipboard operation
django-bootstrap-datepicker-plus copied to clipboard

Button not working

Open PhilippeH1967 opened this issue 5 years ago • 4 comments

I can see template with field date but the button on the right side with the calendar is not working... Thanks for help

needed for using bootstrap_datepicker_plus

BOOTSTRAP3 = { 'include_jquery': True, } and add 'bootstrap_datepicker_plus', in installed apps

html file:

 {%  extends 'imports/base.html' %}
{%  load bootstrap3 %}
<!-- necessaire pour date picker -->
{% block extra_css %}
{{ form.media.css }}
{% endblock %}

{% block extra_js %}
{{ form.media.js }}
{% endblock %}
<!-- Fin date picker -->
{%  block title %}Imports Company{%  endblock %}
{%  block heading %}<h3 class="page-header-center">Creation Company</h3> {%  endblock %}
<hr>
<hr>
{% block page %}
   <form method="POST">
       {%  csrf_token %}
       <div class="col-lg-4 col-md-4 col-sm-4 content">
       {% bootstrap_form company_form %}
       <button type="submit" class="btn btn-pink pull-right">Create</button>
       </div>
   </form>
{% endblock %}

imports/base.html:

{%  load staticfiles %}
{% load bootstrap3 %} {# import bootstrap4/bootstrap3 #}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
<!-- Necessaire pour bootstrap datepicker -->
{% bootstrap_css %} {# Embed Bootstrap CSS #}
{% block extra_css %}
{{ form.media.css }}
{% endblock %}
<!-- fin du code boots trap datepicker -->
    <title>{% block title %}{% endblock %}</title>


    <link rel="stylesheet" href="{%  static 'css/bootstrap.min.css' %}">
    <link rel="stylesheet" href="{%  static 'css/style.css' %}">
    <script src="{%  static 'js/bootstrap.min.js' %}"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

</head>
<body>

<div class="container-fluid">
    <div class="row">
        <div class="col-lg-2 col-md-2 col-sm-2 sidebar">
             {%  block sidebar %}{%  endblock %}
        </div>
        <div class="col-lg-10 col-lg-offset-2 col-md-10 col-md-offset-2 col-sm-10 col-sm-offset-2 content">
                {% block heading %}{% endblock %}
                {%  block page %}{% endblock %}
        </div>
    </div>

</div>


<!-- Necessaire pour bootstrap datepicker -->
{% bootstrap_javascript jquery='full' %} {# Embed Bootstrap JS+jQuery #}
{% block extra_js %}
{{ form.media.js }}
{% endblock %}
<!-- fin du code boots trap datepicker -->


</body>
</html>

and forms.py:

class CompanyForm(forms.ModelForm):
    class Meta:
        model = Company
        fields = ("company_name", "fiscal_end_of_year")
        widgets = {
            'fiscal_end_of_year': DatePickerInput(),  # default date-format %m/%d/%Y will be used
        }

models.py:

class Company(models.Model):
    company_id = models.IntegerField(default=170)
    company_name = models.CharField(max_length=100, null=False)
    fiscal_end_of_year = models.DateField()

PhilippeH1967 avatar Jun 09 '19 00:06 PhilippeH1967

Capture d’écran 2019-06-08 à 20 50 10

PhilippeH1967 avatar Jun 09 '19 00:06 PhilippeH1967

It seems that there is to jquery woring one 1.11 version and another 3.4.1 version. Is this normal ?

PhilippeH1967 avatar Jun 09 '19 00:06 PhilippeH1967

I have the same issue. it works in Safari/Chrome but not in Firefox. Firefox shows the below error in console log.

None of the “sha384” hashes in the integrity attribute match the content of the subresource.

pwalimbe avatar Dec 03 '19 05:12 pwalimbe

Hitting similar issues I followed the guide (https://monim67.github.io/django-bootstrap-datepicker-plus/configure/) and I'm now getting the picker to show up on Firefox but I'm getting the sha384 error above in the console. Did anyone figure this one out?

somada141 avatar Oct 22 '20 02:10 somada141

Closing pre v5 issues as stale. From v5 the error messages are more informative.

monim67 avatar Nov 26 '22 06:11 monim67