diff --git a/cydiapomonella/templates/cydiapomonella/index.html b/cydiapomonella/templates/cydiapomonella/index.html
index 2cd2f0ea3a734b37d3a03ab8edf6d591043b134e..2dcc57bb9f2ad5ca43b7c3dba814c5f0b054fc2a 100644
--- a/cydiapomonella/templates/cydiapomonella/index.html
+++ b/cydiapomonella/templates/cydiapomonella/index.html
@@ -61,12 +61,35 @@
var dateYesterday = getAdjustDate(dateToday,1);
var strEndDate = JSON.stringify(dateToday).substring(1,11);
+ var CON_idSpecial = {
+ "Helgøy" : "536"
+ , "Skiftun" : "537"
+ }
+ /* Page onload function */
$(function(){
+ /* Calendar will not accept future dates including today */
document.getElementById('idTxtDateInput').setAttribute("max", JSON.stringify(dateYesterday).substring(1,11));
$('#idTxtDateInput').removeClass('hasDatepicker');
});
+ /* Function for check whether the choosed weather station is within special category (e.g. devis) */
+ function isSpecialWeatherStation(paramStationId)
+ {
+ var result = false;
+ $.each( CON_idSpecial, function( key, value ) {
+ if (paramStationId === value)
+ {
+ result = true;
+ return false; // exit the each loop
+ }
+ });
+ return result;
+ }
+
+
+
+
/* Function works on date picker onClose event */
function funDtPickerHeatSum()
{
@@ -92,10 +115,7 @@
var startDate = new Date($('#idTxtDateInput').val());
- if(
- varWeatherId === '536' ||
- varWeatherId === '537'
- )
+ if(isSpecialWeatherStation(varWeatherId))
{
strStartDate = JSON.stringify(getAdjustDate(startDate, 2 )).substring(1,11);
jsonParamUrlData = getWeatherDataUrlParam(varWeatherId, strStartDate, strEndDate, varElementMeasurementTypes, varLogInIntervalHourly, CONST_TIMEZONE);
@@ -161,10 +181,7 @@
var dateStartDate = getAdjustDate(dateToday,radioDaysValue);
var strStartDate = JSON.stringify(dateStartDate).substring(1,11);
- if(
- varWeatherId === '536' ||
- varWeatherId === '537'
- )
+ if(isSpecialWeatherStation(varWeatherId))
{
var dateStartDate02 = getAdjustDate(dateToday, (parseInt(radioDaysValue) + 1));
strStartDate = JSON.stringify(dateStartDate02).substring(1,11);
@@ -188,10 +205,7 @@
var jsonParamUrlDataHourly = '';
- if(
- varWeatherId === '536' ||
- varWeatherId === '537'
- )
+ if(isSpecialWeatherStation(varWeatherId))
{
jsonParamUrlDataHourly = {
logInterval : paramLogInInterval,