Календарь на jQuery
by Andrey Dobrovoi
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<div class="container">
<!-- calendar -->
<div id="calendar"></div>
</div>
CSS
html,
body {
background: #e5eaee;
margin: 0;
padding: 0;
font-family: calibri, sans-serif;
}
.container {
width: 100%;
max-width: 800px;
padding: 60px;
margin: 0 auto;
}
/*calendar*/
#calendar {
max-width: 380px;
background: #ffffff;
border-radius: 5px;
margin: 0 auto;
overflow: hidden;
box-shadow: 0 16px 28px 0 rgba(0, 0, 0, .22), 0 25px 55px 0 rgba(0, 0, 0, .21);
}
.ui-datepicker {
margin: 30px 20px;
font-size: 22px;
}
.ui-datepicker a {
text-decoration: none;
color: #6a7883;
}
.ui-datepicker table {
width: 100%;
}
/*Styling the Header Section*/
.ui-datepicker-header {
height: 60px;
border-bottom: 1px solid #c6cdd2;
}
.ui-datepicker-title {
font-size: 32px;
color: #c7c7c7;
text-align: center;
}
.ui-datepicker-prev,
.ui-datepicker-next {
width: 12px;
height: 12px;
text-indent: 9999px;
border-radius: 100%;
cursor: pointer;
overflow: hidden;
margin-top: -12px;
}
.ui-datepicker-prev {
float: left;
margin-left: 12px;
}
.ui-datepicker-prev:after {
transform: rotate(45deg);
}
.ui-datepicker-next {
float: right;
margin-right: 12px;
}
.ui-datepicker-next:after {
transform: rotate(-135deg);
}
.ui-datepicker-prev:after,
.ui-datepicker-next:after {
content: '';
position: absolute;
display: block;
width: 12px;
height: 12px;
border-left: 3px solid #6a7883;
border-bottom: 3px solid #6a7883;
}
.ui-datepicker-calendar thead tr th span {
display: block;
width: 40px;
color: #b1b1b1;
font-size: 16px;
font-weight: 400;
line-height: 50px;
}
/*Styling the Dates*/
.ui-state-default {
display: block;
color: #f26a63;
line-height: 40px;
text-align: center;
font-size: 16px;
width: 40px;
}
.ui-datepicker-other-month .ui-state-default {
color: #bdc5cb;
}
/*active day*/
.ui-state-default:hover {
background: #6a7883;
color: #ffffff;
border: 1px solid #6a7883;
border-radius: 99px;
position: relative;
margin: -1px;
}
.ui-datepicker-calendar...
JavaScript
/* ========================================================================= */
/* shurawi --- dbmast.ru ---
/* ========================================================================= */
/* calendar */
$(function() {
$("#calendar").datepicker({
inline: true,
showOtherMonths: true,
selectOtherMonths: false,
prevText: 'Назад',
nextText: 'Вперёд',
monthNames: ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
dayNames: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Субота'],
dayNamesMin: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'],
firstDay: 1,
});
});