Comments (9)
Wait, but 10.02.2015 is not last date of February, it was current day at the moment of writing.
Can you clarify what you mean?
from pickmeup.
It's the last day that can be selected to form a report, I place current date as max date.
Остальное-то всё понятно или тоже разъяснить? Просто писать на русском нехорошо т.к эти вопросы-ответы не будут потом гуглится.
from pickmeup.
Well, this is very easy to achieve with change
event:
...
change : function () {
$(this).pickmeup('set_date', [$(this).pickmeup('get_date')[0], new Date]);
}
...
Demo: http://jsfiddle.net/z4fmvuzb/32/
from pickmeup.
Seems laggy and not working correctly... Looks like recursive change event.
http://jsfiddle.net/jz0xq9Lf/8/
The second date has always 1st of current month, want - max date(i.e 31,30,29/28) or the current day from the current month(for now it is 11)
from pickmeup.
The second date has always 1st of current month
Wrong, first day of second selected month.
want - max date(i.e 31,30,29/28) or the current day from the current month(for now it is 11)
Will this help?:
date.addMonths(1);
date.addDays(-1);
if (date > max_date) {
date = max_date;
}
Use this in callback before output, or patch internal options.date
before calling get_date
method (I personally do not recommend this to avoid any further issues).
Also $('.range').data('pickmeup-options').format
in demo makes no sense, because current format assumed by default.
from pickmeup.
Also $('.range').data('pickmeup-options').format in demo makes no sense, because current format assumed by default.
Wrong, data will be different from formated because by default it returns the original date object
http://jsfiddle.net/jz0xq9Lf/11/
Wrong, first day of second selected month.
Yeah, the second date will be always 1st, so when you select only one month you will select 01-01-2015 to 01-01-2015, not 01-01-2015 to 31-01-2015 as it is expected.
I'm not calling "get_date"(exept of after initialize, and it is OK to have only one date of today), I'm changing inputs by change callback.
from pickmeup.
Wrong, data will be different from formated because by default it returns the original date object
http://jsfiddle.net/jz0xq9Lf/11/
Yeah, sorry, you have to put true
here to use default format
I'm not calling "get_date"(exept of after initialize, and it is OK to have only one date of today), I'm changing inputs by change callback.
So, you can modify second date in change
event, right?
from pickmeup.
done with changing the callback for periods - now it modyfies the second date, but isn't formatting as the widget(so it is hardcoded)
changeDatePeriod : function(dates, datesObj){ //fixme должен быть задан формат в зависимости от того который в календаре указан
var sdo = datesObj[1],
sd;
sdo.addMonths(1);
sdo.addDays(-1);
sd = sdo.getFullYear()+'-'+('00'+(sdo.getMonth()+1)).slice(-2)+'-'+('00'+(sdo.getDate())).slice(-2);
dates[1] = sd;
this.changeDate(dates);
}
it might be usefull if callback had the 3d argument as this to pickMeUp instance or at least had "format date obj" function
from pickmeup.
Is your problem fixed now and we can close this issue?
In fact, I'm not currently actively using this plugin. It inherited most of structure and inner code from original datepicker by Stefan Petre, and it can be much better (events be like normal DOM events with multiple callbacks if needed, better inner structure, probably, more optima, etc.), but I do not have much time for that right now.
from pickmeup.
Related Issues (20)
- How to clear input value after selecting date HOT 4
- How to add header and footer in datepicker box HOT 1
- How to disable the Selection? HOT 1
- Allow ranges using two input fields instead of one HOT 2
- Highlight dates in between range on mouse over HOT 3
- set_date should override default_date
- get_date returns 'undefined' after '.clear()'
- invalid check "date instanceof Number" HOT 2
- Incorrect calendar appearance after clearing the field HOT 2
- Disambiguation of two-digit years HOT 1
- problem in wordpress, HOT 1
- Show price label in calendar HOT 1
- Add composer.json file HOT 1
- Async userdata loading HOT 2
- Настройка календаря HOT 1
- Bootstrap update for v4 HOT 2
- Initiailise date from input HOT 8
- Add footer HOT 2
- For Two textboxes it is coming(i.e.., for the first and the fourth) and i want only for fourth one to be a date picker HOT 4
- not works for multi date inputs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pickmeup.