issue69, fixed calendar matrix always starting with the current time
[phpfspot.git] / phpfspot.js
index cdd4bc201e8ffee337ffb63a1a260d9b2931d293..6671eb2cb1914a49a4da406cf0bd446055358038 100644 (file)
@@ -151,6 +151,11 @@ function setViewMode(mode)
 function clearSearch()
 {
    document.getElementsByName('searchfor')[0].value = '';
+
+   if(document.getElementsByName('consider_date')[0].checked == true) {
+      document.getElementsByName('consider_date')[0].checked = false;
+      datesearch();
+   }  
 }
 
 function AskServerWhatToDo()
@@ -204,6 +209,8 @@ function getPhotoToShow()
 function showCalendar(date_box, click_obj)
 {
    var calendar = document.getElementById('calendar');
+   var year = document.getElementById(date_box+'year').value;
+   var month = document.getElementById(date_box+'month').value;
    if(date_box == 'from') {
       var xpos = document.getElementById('frompic').offsetLeft;
       var ypos = document.getElementById('frompic').offsetTop;
@@ -220,7 +227,7 @@ function showCalendar(date_box, click_obj)
    if(calendar.style.visibility == "" || calendar.style.visibility == 'hidden') {
       calendar.style.visibility = 'visible';
       calendar.innerHTML = "Loading...";
-      calendar.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=get_calendar_matrix'));
+      calendar.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=get_calendar_matrix&year=' + year + '&month=' + month));
       calendar_shown = 1;
    }
    else {