diff --git a/src/core/pyros_django/pyros/settings.py b/src/core/pyros_django/pyros/settings.py index 0599311..12bd649 100644 --- a/src/core/pyros_django/pyros/settings.py +++ b/src/core/pyros_django/pyros/settings.py @@ -399,7 +399,7 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' python_version = subprocess.run( "python --version | cut -d ' ' -f 2 | cut -d '.' -f 1,2",shell=True,stdout=subprocess.PIPE,universal_newlines=True) python_version = python_version.stdout -today = "2021-11-02" +today = "2021-11-03" django_version_major,django_version_minor = django.VERSION[:2][0],django.VERSION[:2][1] -pyros_version = "0.2.11.0" +pyros_version = "0.2.11.1" VERSION_NUMBER = f"{pyros_version}_{django_version_major}.{django_version_minor}_{python_version}_{today}" \ No newline at end of file diff --git a/src/core/pyros_django/scientific_program/templates/scientific_program/create_period.html b/src/core/pyros_django/scientific_program/templates/scientific_program/create_period.html index e49ea9f..914220c 100644 --- a/src/core/pyros_django/scientific_program/templates/scientific_program/create_period.html +++ b/src/core/pyros_django/scientific_program/templates/scientific_program/create_period.html @@ -149,33 +149,33 @@ function loadDate(){ + parseInt($("#id_validation_duration").val()) + parseInt($("#id_notification_duration").val()); date = period_start_date.addDays(-proposal_duration); submission_start_date = date; - $("#submission_duration_date").html(date.toLocaleDateString("en-GB")); + $("#submission_duration_date").html(date.toLocaleDateString("en-GB") + " (start date)"); - duration_value = parseInt($("#id_evaluation_duration").val()) - date = submission_start_date.addDays(duration_value); + previous_duration = parseInt($("#id_submission_duration").val()) + date = submission_start_date.addDays(previous_duration); evaluation_start_date = date; - $("#evaluation_duration_date").html(date.toLocaleDateString("en-GB")); + $("#evaluation_duration_date").html(date.toLocaleDateString("en-GB") + " (start date)"); - duration_value = parseInt($("#id_validation_duration").val()) - date = evaluation_start_date.addDays(duration_value); + previous_duration = parseInt($("#id_evaluation_duration").val()) + date = evaluation_start_date.addDays(previous_duration); validation_start_date = date; - $("#validation_duration_date").html(date.toLocaleDateString("en-GB")); + $("#validation_duration_date").html(date.toLocaleDateString("en-GB") + " (start date)"); - duration_value = parseInt($("#id_notification_duration").val()) - date = validation_start_date.addDays(duration_value); - $("#notification_duration_date").html(date.toLocaleDateString("en-GB")); + previous_duration = parseInt($("#id_validation_duration").val()) + date = validation_start_date.addDays(previous_duration); + $("#notification_duration_date").html(date.toLocaleDateString("en-GB") + " (start date)"); duration_value = parseInt($("#id_exploitation_duration").val()) date = period_start_date.addDays(duration_value); - $("#exploitation_duration_date").html(date.toLocaleDateString("en-GB")); + $("#exploitation_duration_date").html(date.toLocaleDateString("en-GB")+ " (end date)"); duration_value = parseInt($("#id_property_of_data_duration").val()) date = period_start_date.addDays(duration_value); - $("#property_of_data_duration_date").html(date.toLocaleDateString("en-GB")); + $("#property_of_data_duration_date").html(date.toLocaleDateString("en-GB") + " (end date)"); duration_value = parseInt($("#id_data_accessibility_duration").val()) date = period_start_date.addDays(duration_value); - $("#data_accessibility_duration_date").html(date.toLocaleDateString("en-GB")); + $("#data_accessibility_duration_date").html(date.toLocaleDateString("en-GB") + " (end date)"); } // Set date after page is loaded $( document ).ready(function() { diff --git a/src/core/pyros_django/scientific_program/templates/scientific_program/period_detail_edit.html b/src/core/pyros_django/scientific_program/templates/scientific_program/period_detail_edit.html index b6b3826..fc45b84 100644 --- a/src/core/pyros_django/scientific_program/templates/scientific_program/period_detail_edit.html +++ b/src/core/pyros_django/scientific_program/templates/scientific_program/period_detail_edit.html @@ -138,6 +138,7 @@ Date.prototype.addDays = function(days) { return date; } + function loadDate(){ split = $("#start_date_picker").val().split("/"); period_start_date = new Date(split[2],split[1]-1,split[0]); @@ -146,87 +147,73 @@ function loadDate(){ // set date for each duration duration_value = parseInt($("#id_submission_duration").val()) - date = period_start_date.addDays(-duration_value); - $("#submission_duration_date").html(date.toLocaleDateString("en-GB")); - - duration_value = parseInt($("#id_evaluation_duration").val()) - date = period_start_date.addDays(-duration_value); - $("#evaluation_duration_date").html(date.toLocaleDateString("en-GB")); - - duration_value = parseInt($("#id_validation_duration").val()) - date = period_start_date.addDays(-duration_value); - $("#validation_duration_date").html(date.toLocaleDateString("en-GB")); - - duration_value = parseInt($("#id_notification_duration").val()) - date = period_start_date.addDays(-duration_value); - $("#notification_duration_date").html(date.toLocaleDateString("en-GB")); + proposal_duration = parseInt($("#id_submission_duration").val()) + parseInt($("#id_evaluation_duration").val()) + + parseInt($("#id_validation_duration").val()) + parseInt($("#id_notification_duration").val()); + date = period_start_date.addDays(-proposal_duration); + submission_start_date = date; + $("#submission_duration_date").html(date.toLocaleDateString("en-GB") + " (start date)"); + + previous_duration = parseInt($("#id_submission_duration").val()) + date = submission_start_date.addDays(previous_duration); + evaluation_start_date = date; + $("#evaluation_duration_date").html(date.toLocaleDateString("en-GB") + " (start date)"); + + previous_duration = parseInt($("#id_evaluation_duration").val()) + date = evaluation_start_date.addDays(previous_duration); + validation_start_date = date; + $("#validation_duration_date").html(date.toLocaleDateString("en-GB") + " (start date)"); + + previous_duration = parseInt($("#id_validation_duration").val()) + date = validation_start_date.addDays(previous_duration); + $("#notification_duration_date").html(date.toLocaleDateString("en-GB") + " (start date)"); duration_value = parseInt($("#id_exploitation_duration").val()) date = period_start_date.addDays(duration_value); - $("#exploitation_duration_date").html(date.toLocaleDateString("en-GB")); + $("#exploitation_duration_date").html(date.toLocaleDateString("en-GB")+ " (end date)"); duration_value = parseInt($("#id_property_of_data_duration").val()) date = period_start_date.addDays(duration_value); - $("#property_of_data_duration_date").html(date.toLocaleDateString("en-GB")); + $("#property_of_data_duration_date").html(date.toLocaleDateString("en-GB") + " (end date)"); duration_value = parseInt($("#id_data_accessibility_duration").val()) date = period_start_date.addDays(duration_value); - $("#data_accessibility_duration_date").html(date.toLocaleDateString("en-GB")); + $("#data_accessibility_duration_date").html(date.toLocaleDateString("en-GB") + " (end date)"); } // Set date after page is loaded $( document ).ready(function() { loadDate(); }); + + // IMPORTANT NOTE : In Javascript Month count start to zero (Zero is january, 1 is february etc) $("#id_exploitation_duration").on("input",function(){ - duration_value = parseInt($("#id_exploitation_duration").val()) - split = $("#start_date_picker").val().split("/"); - period_start_date = new Date(split[2],split[1]-1,split[0]); - date = period_start_date.addDays(duration_value); - $("#exploitation_duration_date").html(date.toLocaleDateString("en-GB")); + loadDate(); }); $("#id_submission_duration").on("input",function(){ - duration_value = parseInt($("#id_submission_duration").val()) - split = $("#start_date_picker").val().split("/"); - period_start_date = new Date(split[2],split[1]-1,split[0]); - date = period_start_date.addDays(duration_value); - $("#submission_duration_date").html(date.toLocaleDateString("en-GB")); + loadDate(); }); $("#id_evaluation_duration").on("input",function(){ - duration_value = parseInt($("#id_evaluation_duration").val()) - split = $("#start_date_picker").val().split("/"); - period_start_date = new Date(split[2],split[1]-1,split[0]); - date = period_start_date.addDays(duration_value); - $("#evaluation_duration_date").html(date.toLocaleDateString("en-GB")); + loadDate(); }); -$("#id_notation_duration").on("input",function(){ - duration_value = parseInt($("#id_notation_duration").val()) - split = $("#start_date_picker").val().split("/"); - period_start_date = new Date(split[2],split[1]-1,split[0]); - date = period_start_date.addDays(duration_value); - $("#notation_duration_date").html(date.toLocaleDateString("en-GB")); +$("#id_validation_duration").on("input",function(){ + loadDate(); +}); + +$("#id_notification_duration").on("input",function(){ + loadDate(); }); $("#id_property_of_data_duration").on("input",function(){ - duration_value = parseInt($("#id_property_of_data_duration").val()) - split = $("#start_date_picker").val().split("/"); - period_start_date = new Date(split[2],split[1]-1,split[0]); - date = period_start_date.addDays(duration_value); - $("#property_of_data_duration_date").html(date.toLocaleDateString("en-GB")); + loadDate(); }); $("#id_data_accessibility_duration").on("input",function(){ - duration_value = parseInt($("#id_data_accessibility_duration").val()) - split = $("#start_date_picker").val().split("/"); - period_start_date = new Date(split[2],split[1]-1,split[0]); - date = period_start_date.addDays(duration_value); - $("#data_accessibility_duration_date").html(date.toLocaleDateString("en-GB")); + loadDate(); }); - // IMPORTANT NOTE : In Javascript Month count start to zero (Zero is january, 1 is february etc) $(function() { var dateFormat = "dd/mm/yy"; -- libgit2 0.21.2