Skip to content
Snippets Groups Projects
Commit 8e7445c5 authored by Bhabesh Bhabani Mukhopadhyay's avatar Bhabesh Bhabani Mukhopadhyay
Browse files

JQuery Datepicker and datatable information removed

JQuery Datepicker replaced by html 5 'date' component.
parent 6aa8702a
Branches
Tags
1 merge request!7Eplevikler
{% extends "base.html" %} {% extends "base.html" %}
{% load static %}
{% load staticfiles %} {% load staticfiles %}
{% comment %} {% comment %}
# #
...@@ -48,8 +44,16 @@ ...@@ -48,8 +44,16 @@
{% endblock %} {% endblock %}
{% block customCSS %}
<style>
.navbar-default {
background-color: #fff;
border-color:#fff;
}
</style>
{% endblock %}
{% block customJS %} {% block customJS %}
{% csrf_token %}
<script type="text/javascript"> <script type="text/javascript">
var CONST_TIMEZONE = 'Europe/Oslo'; var CONST_TIMEZONE = 'Europe/Oslo';
var dateToday = new Date(); var dateToday = new Date();
...@@ -62,6 +66,7 @@ ...@@ -62,6 +66,7 @@
var jsonMeasurdData = ""; var jsonMeasurdData = "";
$(function(){ $(function(){
document.getElementById('idTxtDateInput').setAttribute("max", JSON.stringify(dateYesterday).substring(1,11));
$('#idTxtDateInput').removeClass('hasDatepicker'); $('#idTxtDateInput').removeClass('hasDatepicker');
}); });
...@@ -95,6 +100,7 @@ ...@@ -95,6 +100,7 @@
} }
/* Date input to get heat sum calculation */ /* Date input to get heat sum calculation */
/*
$('#idTxtDateInput').datepicker({ $('#idTxtDateInput').datepicker({
dateFormat: 'yy-mm-dd', dateFormat: 'yy-mm-dd',
showOn: "both", showOn: "both",
...@@ -104,6 +110,13 @@ ...@@ -104,6 +110,13 @@
funDtPickerHeatSum(); funDtPickerHeatSum();
} }
}); });
*/
$('#idTxtDateInput').change(function(){
funDtPickerHeatSum();
});
/* On change of drop down for weather stations */ /* On change of drop down for weather stations */
$('#weatherStationId').change(function(){ $('#weatherStationId').change(function(){
...@@ -135,7 +148,8 @@ ...@@ -135,7 +148,8 @@
jsonHourlyData = getAjaxHourlyData(jsonParamUrlDataHourly); jsonHourlyData = getAjaxHourlyData(jsonParamUrlDataHourly);
$('#idTxtDateInput').datepicker("setDate",dateStartDate); //$('#idTxtDateInput').datepicker("setDate",dateStartDate);
document.querySelector("#idTxtDateInput").valueAsDate = dateStartDate;
/*Calling function to calculate and place heatsum value based upon date placed on datepicker*/ /*Calling function to calculate and place heatsum value based upon date placed on datepicker*/
funDtPickerHeatSum(); funDtPickerHeatSum();
...@@ -316,7 +330,7 @@ ...@@ -316,7 +330,7 @@
if($.trim(weatherData)) if($.trim(weatherData))
{ {
$('#idTableWeather').DataTable({ $('#idTableWeather').DataTable({
"sDom": '<t><"col-sm-5"i><"clearfix">', "sDom": '<t><"clearfix">',
"lengthMenu": [[50, -1], ["All"]], "lengthMenu": [[50, -1], ["All"]],
"aaData" : weatherData, "aaData" : weatherData,
"aoColumns" : "aoColumns" :
...@@ -491,11 +505,11 @@ ...@@ -491,11 +505,11 @@
{% block content %} {% block content %}
<center>
<div class="alert alert-info" role="alert"> <div class="col-md-12" >
<h3>Calculate the risk of attack by apple wrap</h3> <h1>Calculate the risk of attack by apple wrap</h1>
</div> </div>
</center>
<div class="container-fluid"> <div class="container-fluid">
<div class="row "> <div class="row ">
...@@ -571,7 +585,7 @@ ...@@ -571,7 +585,7 @@
<div class="form-group form-inline"> <div class="form-group form-inline">
<label for="nameTxtDateInput">Calculate heat sum from Date:</label> <label for="nameTxtDateInput">Calculate heat sum from Date:</label>
<input id="idTxtDateInput" name="nameTxtDateInput" class="notranslate form-control" readonly/> <input id="idTxtDateInput" name="nameTxtDateInput" class="form-control" type="date" placeholder="yyyy-mm-dd" onkeydown="return false" value="2020-01-01"/>
</div> </div>
<!-- button type="submit" class="btn btn-default">Submit</button --> <!-- button type="submit" class="btn btn-default">Submit</button -->
</form> </form>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment