Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Add date pickers for the start dates of workout schedules

Roland Geiderea48f85ce6c9
diff --git a/wger/manager/static/js/workout-manager.js b/wger/manager/static/js/workout-manager.js
index 99131200f..a90348240 100644
--- a/wger/manager/static/js/workout-manager.js
+++ b/wger/manager/static/js/workout-manager.js
@@ -447,6 +447,11 @@ function init_edit_set()
});
}
+function init_schedule_datepicker()
+{
+ $( "#id_start_date" ).datepicker();
+}
+
function init_weight_datepicker()
{
$( "#id_creation_date" ).datepicker();
diff --git a/wger/manager/templates/schedule/overview.html b/wger/manager/templates/schedule/overview.html
index 32bc906ad..b723f35e6 100644
--- a/wger/manager/templates/schedule/overview.html
+++ b/wger/manager/templates/schedule/overview.html
@@ -6,6 +6,17 @@
{% block title %}{% trans "Your schedules" %}{% endblock %}
+{% block header %}
+<script type="text/javascript">
+
+// Initialise the datepicker for the modal dialog
+function custom_modal_init()
+{
+ init_schedule_datepicker();
+}
+</script>
+{% endblock %}
+
{% block content %}
<table id="workout-table">
<thead>
diff --git a/wger/manager/templates/schedule/view.html b/wger/manager/templates/schedule/view.html
index 5c4c24f72..cd5834e41 100644
--- a/wger/manager/templates/schedule/view.html
+++ b/wger/manager/templates/schedule/view.html
@@ -34,8 +34,15 @@ function init_sortable()
})
}
+// Initialise the datepicker for the modal dialog
+function custom_modal_init()
+{
+ init_schedule_datepicker();
+}
+
$(function() {
init_sortable();
+ init_schedule_datepicker();
});
</script>
{% endblock %}