@ -18,7 +18,17 @@ function clean_user_select() {
.end();
}
var reg = 'fr';
$(document).ready(function() {
/*$("body").delegate(".datetime", "focusin", function() {
$(this).datepicker( {
stepMinute: 10,
dateFormat: 'dd/mm/yy',
timeFormat: 'hh:mm:ss'
});
});*/
var date = new Date();
var d = date.getDate();
@ -70,6 +80,8 @@ $(document).ready(function() {
//$("#users_to_send_id").trigger("liszt:updated");
}
});
$.datepicker.setDefaults( $.datepicker.regional["fr"] );
var calendar = $('#calendar').fullCalendar( {
header: {
@ -82,12 +94,13 @@ $(document).ready(function() {
monthNamesShort: { $month_names_short } ,
dayNames: { $day_names } ,
dayNamesShort: { $day_names_short } ,
firstHour: 8,
firstDay: 1,
selectable : true,
selectHelper: true,
//add event
select: function(start, end, allDay, jsEvent, view) {
/* When selecting one day or several days */
/* When selecting one day or several days */
var start_date = Math.round(start.getTime() / 1000);
var end_date = Math.round(end.getTime() / 1000);
@ -106,18 +119,22 @@ $(document).ready(function() {
if ( { $can_add_events } == 1) {
var url = ' { $web_agenda_ajax_url } &a=add_event&start='+start_date+'&end='+end_date+'&all_day='+allDay+'&view='+view.name;
var start_date_value = $.datepicker.formatDate(' { $js_format_date } ', start);
var end_date_value = $.datepicker.formatDate(' { $js_format_date } ', end);
$('#start_date').html(start.toDateString() + " " + start.toTimeString().substr(0, 8));
$('#start_date').html(start_date_value + " " + start.toTimeString().substr(0, 8));
if (view.name != 'month') {
$('#start_date').html(start.toDateString() + " " + start.toTimeString().substr(0, 8));
$('#start_date').html(start_date_value + " " + start.toTimeString().substr(0, 8));
if (start.toDateString() == end.toDateString()) {
$('#end_date').html(' - '+end.toTimeString().substr(0, 8));
} else {
$('#end_date').html(' - '+end.toDateString() +" " + end.toTimeString().substr(0, 8));
$('#end_date').html(' - '+start_date_value +" " + end.toTimeString().substr(0, 8));
}
} else {
$('#start_date').html(start.toDateString() );
$('#end_date').html(' - ' + end.toDateString() );
$('#start_date').html(start_date_value );
$('#end_date').html(' ');
}
$('#color_calendar').html(' { $type_label } ');
$('#color_calendar').removeClass('group_event');
@ -324,6 +341,8 @@ $(document).ready(function() {
</div>
<div class="formw">
<span id="start_date"></span><span id="end_date"></span>
<!-- <input type="text" id="start_date_input" class="datetime"/>
<input type="text" id="end_date_input" class="datetime"/> -->
</div>
</div>
<div class="row">