$(this).validate({
ignore: [],
invalidHandler: function() {
var errorList = '';
setTimeout(function(){
var errorList = $('select.error');
errorList.siblings().find('p').addClass('error');
errorList.change(function() {
errorList.siblings().find('p').removeClass('error');
});
},1);
}
});
$('.week-view .hour-grid .days .day').each(function () {
const cell = $(this).find('.cell');
for (let i = 0; i < cell.length; i++) {
const eventsList = cell[i];
const events = eventsList.children.length; // 2
for (const event of eventsList.children) {
event.classList.add('overlap');
}
if (events > 1) {
for (let y = 0; y < events; y++) {
let left = 100 / events * y + '%';
let right = 100 - 100 / events * (y + 1) + '%';
console.log(left); //0% // 50%
console.log(right); //50% // 0%
$('.event-item.overlap').eq(y).css({
'left': left,
'right': right
});
}
}
}
})
data.addRows([
{% for stat in launched_product.get_all_statistic %}
[new Date ({{ stat.timestamp|date:"Y, m-<b>1</b>, d" }}), {{ stat.kw_rank }}, {{ stat.bsr }}],
{% endfor %}
]);
в получаемых django данных отнимаю от месяца 1, и результат
01/07/18, 01/12/18, 01/16/18
$(function() {
var datepicker = $('.datepicker-here').datepicker({
onSelect: function(formattedDate, date, inst) {
localStorage.setItem("datepickerDate", date);
},
onRenderCell: function(date, cellType) {
if (cellType == 'day') {
var today = new Date();
today.setHours(0, 0, 0, 0);
if (today && date <= +today + 86400000 * 3) {
return {
disabled: true
}
}
}
},
minDate: new Date(),
position: 'left bottom',
language: {
days: ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],
daysShort: ['Su','Mo','Tu','We','Th','Fr','Sa'],
daysMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
months: ['January','February','March','April','May','June','July','August','September','October','November','December'],
monthsShort: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Okt','Nov','Dec'],
today: 'Today',
select: '',
clear: 'clear',
dateFormat: 'yyyy-mm-dd',
timeFormat: '',
firstDay: 1
}
}).data('datepicker');
var selectedDate = localStorage.getItem("datepickerDate");
if (selectedDate !== null && selectedDate !== '') datepicker.selectDate(new Date(selectedDate));
});
<div class="col-3@xs col-4@sm col-3@md col-2@lg product-item-inner" data-groups='[""]' data-status="" data-date-created="" data-title="">
<img class="transform-x-y" src="{% static 'jl/cd/img/plus.png' %}" alt="plus">
</div>
// ~ Compile JS ~
var jsFilter = gulpFilter('**/*.js');
// Concat vendor JS (uglify for production)
gulp.task('js:vendor', function() {
gulp.src(mainBowerFiles({
"overrides": {
"jquery": {
"main": "./dist/jquery.min.js"
},
"magnific-popup": {
"main": "./dist/jquery.magnific-popup.min.js"
},
"slick-carousel": {
"main": "./slick/slick.min.js"
},
"readmore-js": {
"main": "./readmore.js"
}
}
}))
.pipe(jsFilter)
.pipe(concat('vendor.js'))
.pipe(gulpIf(env !== 'dev', uglify()))
.pipe(size())
.pipe(gulp.dest(outputDir + 'js'))
});
// Concat own JS (uglify for production)
gulp.task('js', function() {
gulp.src(src.js)
.pipe(jsHint())
.pipe(jsHint.reporter('default'))
.pipe(concat('script.js'))
.pipe(gulpIf(env !== 'dev', uglify()))
.pipe(gulp.dest(outputDir + 'js'))
.pipe(size())
.pipe(connect.reload());
});
.banner {
text-align: center;
vertical-align: top;
padding-top: 16px;
padding-bottom: 25px;
max-width: 760px;
width: 100%;
}