Skip to content
Snippets Groups Projects
Commit 0753042f authored by Valentin Groues's avatar Valentin Groues :eyes:
Browse files

add datepicker for daily planning #208

parent ca399839
No related branches found
No related tags found
1 merge request!131Resolve "add possibility to select date in daily planning"
Pipeline #
...@@ -237,6 +237,22 @@ $(document).ready(function () { ...@@ -237,6 +237,22 @@ $(document).ready(function () {
groupByResource: true, groupByResource: true,
height: "auto", height: "auto",
customButtons: { customButtons: {
datePickerButton: {
text: 'select',
click: function () {
var $btnCustom = $('.fc-datePickerButton-button');
if ($(".calendar-datepicker").length > 0) {
$(".calendar-datepicker").remove();
}
else {
$btnCustom.after('<div class="calendar-datepicker"/>');
$(".calendar-datepicker").datepicker().on('changeDate', function (ev) {
$('#calendar').fullCalendar('gotoDate', ev.date);
$(".calendar-datepicker").remove();
});
}
}
},
save: { save: {
text: 'Save', text: 'Save',
click: function () { click: function () {
...@@ -333,7 +349,7 @@ $(document).ready(function () { ...@@ -333,7 +349,7 @@ $(document).ready(function () {
}, },
header: { header: {
left: 'prev,next today', left: 'prev,next today',
center: 'title', center: 'title, datePickerButton',
right: 'save, clear, toPdf' right: 'save, clear, toPdf'
}, },
droppable: true, droppable: true,
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
/> />
<link rel="stylesheet" href="{% static 'fullcalendar-scheduler/scheduler.min.css' %}"> <link rel="stylesheet" href="{% static 'fullcalendar-scheduler/scheduler.min.css' %}">
<link rel="stylesheet" href="{% static 'css/daily_planning.css' %}"> <link rel="stylesheet" href="{% static 'css/daily_planning.css' %}">
{% include "includes/datepicker.css.html" %}
{% endblock styles %} {% endblock styles %}
{% block ui_active_tab %}'daily_planning'{% endblock ui_active_tab %} {% block ui_active_tab %}'daily_planning'{% endblock ui_active_tab %}
...@@ -48,6 +49,7 @@ ...@@ -48,6 +49,7 @@
var resources_url = '{% url 'web.api.workers' %}'; var resources_url = '{% url 'web.api.workers' %}';
var events_url = '{% url 'web.api.events_persist' %}'; var events_url = '{% url 'web.api.events_persist' %}';
</script> </script>
{% include "includes/datepicker.js.html" %}
<script src="{% static 'js/daily_planning.js' %}"></script> <script src="{% static 'js/daily_planning.js' %}"></script>
<script src="{% static 'jspdf.min.js' %}"></script> <script src="{% static 'jspdf.min.js' %}"></script>
<script src="{% static 'html2canvas/html2canvas.min.js' %}"></script> <script src="{% static 'html2canvas/html2canvas.min.js' %}"></script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment