Skip to content
This repository has been archived by the owner on Dec 18, 2021. It is now read-only.

Issues 383 fix the calendar overview #398

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 39 additions & 19 deletions assets/js/prozer.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,38 +749,58 @@ function pz_clip_select(clip_id, clip_name, clip_size)


/* ******************* Calendar **************** */

function pz_selected_calendar_frame(select, ids, time, day){
var uri,
$_calender = $('.calendar.view-overview'),
$_data = $_calender.find("[data-calendar-"+select+"='" + time + "']:not('.month-after, .month-before')"),
url = '/screen/calendars/'+select+'/?mode=search&project_ids='+ids+'&day=';
var uri, $_data;
var url = '/screen/calendars/'+select+'/?mode=search&project_ids='+ids+'&day=';
var $_calender = $('.calendar.view-overview');

$_calender.find("[data-calendar-day]").removeClass('selected');
$_calender.find("[data-calendar-day]").removeClass('selected');

if($_data.length == 0) {
if(select == 'day') {
uri = url+time;
if (select == 'week') {
var first_data = $_calender.find(".first [data-calendar-"+select+"='" + time + "']");
var last_data = $_calender.find(".last [data-calendar-"+select+"='" + time + "']");

pz_loadPage('calendar_events_day_search', uri);
return;
if (first_data.length > last_data.length) {
$_data = first_data;
} else {
$_data = last_data;
}
}

if(select == 'week') {
uri = url+day;
if (select == 'day') {
$_data = $_calender.find("[data-calendar-"+select+"='" + time + "']:not('.month-after, .month-before')");

pz_loadPage('calendar_events_week_search', uri);
return;
if($_data.length == 0) {
$_data = $_calender.find("[data-calendar-" + select + "='" + time + "']");
}
}




if($_data.length == 0) {

if(select == 'day') {
uri = url+time;

pz_loadPage('calendar_events_day_search', uri);
return;
}

if(select == 'week') {
uri = url+day;

pz_loadPage('calendar_events_week_search', uri);
return;
}
}
}

$_data.addClass('selected');
$_data.addClass('selected');
}

// ----- form
function pz_set_calendar_addform_date(formdate) {
$("#calendar_event_add_form input[name='from[date]']").val(formdate);
$("#calendar_event_add_form input[name='to[date]']").val(formdate);
$('.xform-datepicker').datepicker("setDate", formdate);
}


Expand Down