Project

General

Profile

« Previous | Next » 

Revision b696867e

Added by Serghei Mihai over 12 years ago

agenda: highlight the currently choosen date in the datepicker instead of today

Closes #3433

View differences:

calebasse/static/css/calebasse.datesel.css
.unactive-cell a {
background: url("images/ui-bg_glass_75_e6e6e6_1x400.png") repeat-x scroll 50% 50% #E6E6E6 !important;
border: 1px solid #D3D3D3 !important;
color: #555555 !important;
font-weight: normal
}
.active-cell a {
background: url("images/ui-bg_glass_55_fbf9ee_1x400.png") repeat-x scroll 50% 50% #FBF9EE !important;
border: 1px solid #FCEFA1 !important;
color: #363636 !important;
}
calebasse/static/js/calebasse.datesel.js
$('#date-selector').datepicker({
dateFormat: "DD d MM yy",
showWeek: true,
beforeShowDay: function(date) {
var selected_date = location.pathname.split('/')[3];
var year = date.getFullYear();
var month = date.getMonth() + 1;
var day = date.getDate();
var possible_current = [year + '-' + month + '-' + day,
year + (month < 10? '-0': '-') + month +
(day < 10? '-0': '-') + day];
return [true, $.inArray(selected_date, possible_current) >= 0 ? 'active-cell': 'unactive-cell']
},
onClose: function(dateText, inst) {
console.log('close');
}
calebasse/templates/calebasse/base.html
<link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/ajax_select.css"/>
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/calebasse.checkboxwidget.css" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/calebasse.divmenu.css" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/calebasse.datesel.css" />
<script src="{{ STATIC_URL }}js/jquery-1.7.2.min.js"></script>
<script src="{{ STATIC_URL }}js/jquery.cookie.js"></script>
<script>$.cookie.json = true;</script>

Also available in: Unified diff