nazar-pc / pickmeup Goto Github PK
View Code? Open in Web Editor NEWReally simple, powerful, customizable and lightweight standalone datepicker
License: BSD Zero Clause License
Really simple, powerful, customizable and lightweight standalone datepicker
License: BSD Zero Clause License
Сейчас календарь не закрывается, если кликнуть повторно на поле, которое его открыло. Приходится писать кастыли через before_show и setTimeout.
If you use
$('input[type=date]').pickmeup();
all the callbacks get applied to the first selector match. While I'm not sure the following change doesn't have any other affects, changing
options[i] = options[i].bind(this);
to $this.bind(options[i]);
on https://github.com/nazar-pc/PickMeUp/blob/master/js/jquery.pickmeup.js#L718 fixes it.
This is because you aren't binding the callbacks to the selector, so this
always refers to the first matched selector.
Задача: есть инпут, при клике на который показывается календарь с выбором одной даты. Есть кнопка "выбрать диапазон", при клике на которую нужно показывать календарь с выбором диапазона для того же инпута.
Как лучше этого добиться?
Спасибо за отличный плагин!
В проекте календарь используется несколько раз. В некоторых местах не нужно давать пользователю выбирать год, а в некоторых и месяц, только число месяца. Подскажите, как это можно сделать.
Было бы здорово, если бы можно было вообще отключать выбор года и месяца. Иногда понятнее и быстрее пролистать несколько месяцев стрелочками.
Ещё сейчас не очень красиво получается, когда можно листать далеко за пределы доступных дат. Допустим, у нас доступным промежутком указан 2014 год, а листать можно за много лет вперёд и назад, хотя там все даты задисейблены.
Заранее спасибо!
I'm not sure why this is required, but I had to steal your
change: function (formatted) {
$(this).val(formatted);
}
from your demo.js
file in order for selecting a date to do anything. Why is the default to not actually set input to the date selected?
Please create a bower.json and register the package. It's the most common package manager for front-end packages. Would be nice to be able to automatically update PickMeUp.
В чем именно сложность поддержки этого браузера?
Подскажите, пожалуйста, как реализовать когда "calendars: 2" чтобы первый календарь был первым, в данный момент первый предыдущий месяц почему-то. Заранее спасибо
For example - I have multiple calendars, one visible at a time and I want to show only one field with inputs.
This is crucial because I have different callbacks for days and month selection.
I've switched back and forth between the commit prior to 78226aa and the commit itself. When using the current version with that commit, all the numbers seems to show NaN instead.
Broken: http://jsfiddle.net/7n4bB/1/
Working: http://jsfiddle.net/364D9/1/
В связке с бекбоне не отрабатывает событие change если на форму уже повешен PickMeUp.
вызов
...
el:"#statistic_show_phone",
events:{
'change #date_end_shp' : 'getDate'
},
initialize:function(){
$('#date_end_shp').pickmeup({
position : 'right',
format : 'd.m.Y',
hide_on_select : true
});
...
пролечил jquery.pickmeup.js
...
(function (prepared_date) {
if ($this.is('input')) {
$this.val(options.mode == 'single' ? prepared_date[0] : prepared_date[0].join(options.separator));
}
options.change.apply(this, prepared_date);
//:FIX: Исправляет несработавшее событие «change»
$this.trigger("change");
})(prepareDate(options));
...
Any chance to?
Unable to change start date when scrolling to a
previous month, i.e. Dec. 12 to Jan. 11. Month selector remains frozen on
Dec. and will not go back to January. Same for year selector, it would not
choose 2015.
I'm using Chrome on a Mac v39.0.2171.95
Just to point out that this feature is planned
mode: range, between first and second date selected, issue clear.
the next date selected is taken as the second date in the date range rather than the first.
I'm using this in a rails application and initializing it on all date inputs with:
$('[type=date]').pickmeup();
but when the date drops down and I select a date, it fails to update the input. It's like my clicks are just ignored
When you select a date range in 3 calendars view and click on a non-current calendar, the view updates and the month I clicked in becomes the one at the centre. This behaviour confuses users a lot since they need to understand that the month has moved and they need to make the second click in a different month block. Please remove the feature or add an option to avoid month change when clicked on a date.
Когда мы выбираем диапазон дат в виде с 3-мя календарями и жмем не на текущий месяц, календарь обновляется и тот, на который мы нажали, переносится в центр. Такое поведение вводит пользователей в заблуждение, поскольку им необходимо понять, что текущий месяц изменился и второй клик надо делать в другом блоке. Пожалуйста, исправьте подобное поведение либо добавьте опцию для того, чтобы смены активного месяца при клике на дату не происходило.
PickMeUp should close itself when the field that it is attached to has lost focus.
Если в текстовом поле уже присутствует какой либо текст и при попытке ввода в поле, появляется окно выбора даты с NaN. Решил небольшой правкой кода, сделал проверку в функции show на корректность созданного объекта Date, если некорректен, то присваиваю текущую дату.
Any thoughts about how to enable first-day to last day month selection?
Now I have 01.01.2015-01.02.2015, want to have 01.01.2015-10.02.2015(i.e the last day of current month)
How to disable changing of the current month when using the 3 calendars + range demo?
It happens when you click on left or right month and sometimes is kind of unexpected.
Also can I have my own types of selection? Like quarter picker?
Add destroy() method for de-initialization instance of plugin
Доброго дня, не могли бы вы помочь в двух вопросах.
но после выбора даты и потери фокуса на календаре или инпуте - календарь исчезает
How I can dynamically reload locale? Only .destroy + .pickmeup() again?
В приложении есть необходимость смены языка на лету. В текущей кодовой базе есть возможность перестройки HTML по требованию? Судя по:
if ($this.data('pickmeup-options')) {
return;
}
нету :) или я плохо искал? воспользовался убиением и последующим воскрешением с прежними параметрами. Но это не очень производительно.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Как можно реализовать вставку 2х дат в 2 поля, при использовании Range?
or not?)
доброго дня.
підкажіть, будь ласка, як виводити календарний блок в іе8. На даний момент він просто відсутній.
Выбор даты за модальным окном. Вот пример: вставьте только ресурсы: бутстрап js и бутстрап css и плагины js и css. Я вставляю - у меня не взлетает. Времени возится нет с этим фидлом.
Прекрасное решение. А можно добавить кнопку "Сегодня" для выбора текущей даты?
There is seems to be an error in Safari (v 5.0.3):
"TypeError: Result of expression 'options[i].bind' [undefined] is not a function."
Calender is not able to load after that.
Error is located here:
"if($.inArray(i,["render","change","before_show","show","hide"])!=-1){options[i]=options[i].bind(this);}"
You can't chain-call the addMonths, i.e new Date().addMonths(1).addDays(-1) because addMonths returns undefined.
Those functions should return the result(i.e , not only modify the actual date but also return that date object).
Maybe return this; will help
при отображении календаря стоит май 1935 года. не то, чтобы я привиредливая, но можно как-то поставить стартом календаря текущую дату?
iOS 8.1.2
Собственно сабж, было бы очень полезной функцией
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
I use input field with single date select, and when I use 'set_date' method to set new date, the input value and date picker representation remains the same, while 'get_date' returns the date I have just set.
I found a workaround - to set input value directly and then call 'update' method, but it's a bit inconvenient, as I have to format date before setting input value, while I'd prefer to use native js Date object.
Thank you.
Currently doing by fully re-initializing with previous state except few modifications.
Было бы здорово добавить опцию 'select day' (по аналогии с select_month и select_year), например, для случая, когда нужно выбирать только год и месяц
Hello, Nazar!
Is it possible to have the ability to disable dates before current date or specified dates?
Если поле дата имеет формат timestamp или в поле случайно добавлен символ - календарь выводится со значениями NaN.
Добавьте обработку, если не удалось распознать дату - выводить в календаре текущую дату.
Собственно если hide_on_select: true + mode: 'range', то после второго клика по input сбрасывается в инпуте конечная дата на начальную
Спасибо за модуль, пригодился.
Только сначала не увидел всплывающий календарь...
решение оказалось таким:
http://joxi.ru/8AnBg5Xf0VyRAO
Возможно, есть смысл добавить его в исходники?
Может опция какая отвечает за это, то какая ? А то года бесконечные xD
Hi.
I try to use format 'Y-m-d H:M:S', but its set 00:00:00 for time.
I just need current time without time picker of time.
I'm using bootstrap integrated version.
My issue is, I have noticed that disabled dates don't change their appearance compared to normal dates.
So I have changed disabled variable in jquery.pickmeup.twitter-bootstrap.min.js
because I haven't found "uk-button" class in bootstrap css files.
Please tell if I'm misunderstanding something or there is a problem.
using an icon as the prev or next eles prevents the prev and next events from being triggered.
Temp solution:
$('.pmu-prev .icon, .pmu-next .icon').on('click', function() {
$(this).closest('.pmu-button').trigger('click');
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.