asmaoui / jquery-datepicker

Automatically exported from code.google.com/p/jquery-datepicker
0 stars 0 forks source link

Create any numbers of months per calendar(multi-month) #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello! Kelvin, 

I want to implement multi-month in a calendar instance like this:
http://ui.jquery.com/demos/datepicker#multiple_calendars
or:
http://developer.yahoo.com/yui/examples/calendar/calnavigator.html

Which only need to pass a parameter to the constructor, e.g.
"numberOfMonths:2,".

Could you give me any hints?

Thanks in advance!

Original issue reported on code.google.com by idea...@gmail.com on 13 Jan 2009 at 2:27

GoogleCodeExporter commented 9 years ago
Hi,

This is something I have been meaning to implement for a long time. A while 
back I
put together an example of how you can kind of achieve this yourself by using
features of the plugin:

http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerMultiMonth.
html

However, it would be much better if you could pass a parameter to the 
constructor and
the plugin would do it for you...

I will put it on my list of things to do and try to add it when I get a 
chance... I'm
not sure how soon that will be however. In the meantime you may want to see if 
the
example above can help you to do what you are trying to do...

Cheers,

Kelvin :)

Original comment by kelvin.l...@gmail.com on 13 Jan 2009 at 5:12

GoogleCodeExporter commented 9 years ago
Kelvin,

Thanks for your time!

I've tried it before submit this ticket. However, I've found it can not provide 
some
features like "sharing internal variables" and "get selected days" 
conveniently, as
they are difference instances.

I'll try to hacking it, and submit the patch if succeed.

Regards!
Mo

Original comment by idea...@gmail.com on 14 Jan 2009 at 1:23

GoogleCodeExporter commented 9 years ago
I have attempted to create a year view. Creating 12 instances of the calendar 
using
this page as an example. 

http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerMultiMonth.
html

The selected date function works for each instance, but I can't get the months 
to
refresh even with the .bind on dpMonthChanged. Any ideas? I can supply code if 
you
like but its virtually the same as your 2 month multi-month version, just 
expanded to 12.

Thanks

Original comment by teamwen...@gmail.com on 3 Feb 2009 at 11:52

GoogleCodeExporter commented 9 years ago
Hi teamwenger,

Are you using the latest datepicker code? I fixed some bugs related to calendars
refreshing since the last release... You can get the latest code from svn here 
or
from my site...

Also, you say: "I can't get the months to refresh" - what exactly do you mean?

Cheers,

Kelvin :)

Original comment by kelvin.l...@gmail.com on 4 Feb 2009 at 5:00

GoogleCodeExporter commented 9 years ago
Kelvin, thanks for the reply and all the work you put into this plugin.

I will check my code version and update if necessary. When I said the statement 
about
the months refreshing I meant when I use the dpMonthChanged callback on one of 
the
instances, using the dpSetDisplayedMonth function doesnt actually refresh the 
other
instances:

$date2.dpSetDisplayedMonth(displayedMonth+1, displayedYear);

This does nothing on mine. I have $date2 through $date12 with similar function 
calls.
I noticed your example does refresh accordingly, so lets hope I have an older 
version
and updating the plugin will fix this. I'll let ya know.

Thanks

Original comment by teamwen...@gmail.com on 4 Feb 2009 at 6:45

GoogleCodeExporter commented 9 years ago
I downloaded the latest version and rendering works much better. Thanks again.

Original comment by teamwen...@gmail.com on 4 Feb 2009 at 4:26

GoogleCodeExporter commented 9 years ago
One thing I noticed with multi month setups is that when you select a date that 
occurs in two views at once, every calendar date that matches that number is 
selected 
across every calendar.

For example: selecting the 28th of July 2009 will select the 28 of July in the 
August 
instance. This is intended. However, it also selects the 28th of every instance 
that 
shows a previous months 28th. To clear up the example, selecting the 28th of 
July 
will also select February 28 in the March view, 28th of April in the May view, 
28 of 
September int he October view and so on where a previous months date shows in 
the 
next month. Hope this is clear.

Thanks

Original comment by teamwen...@gmail.com on 4 Feb 2009 at 5:24

GoogleCodeExporter commented 9 years ago
Yes - this makes sense teamwenger... I will look into it ASAP and try to fix 
it, I
suspect half of the correct code is already there because I recently changed 
some
code from simply checking the text inside the cells to checking an actual 
complete
date which I am storing on the .data of the relevant td...

I'll update here once I've done a fix, thanks for the report...

Original comment by kelvin.l...@gmail.com on 5 Feb 2009 at 4:28

GoogleCodeExporter commented 9 years ago
Hi,

I extended my multimonth select example out into three months:

http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerMultiMonth2
.html

And I'm not seeing the problem you describe... Maybe I had already fixed it
previously? Are you using the latest date picker code from svn or from my site?

Cheers,

Kelvin :)

Original comment by kelvin.l...@gmail.com on 8 Feb 2009 at 6:32

GoogleCodeExporter commented 9 years ago
Oh, I think the difference is in the multiple select option. If you take your 
example 
and allow for multiple selections, I think you will see the issue. Thanks for 
working 
on this.

Original comment by teamwen...@gmail.com on 8 Feb 2009 at 6:37

GoogleCodeExporter commented 9 years ago
I just updated the example linked above to use multiple selection and it still 
seems
to work fine... Are you sure you have the latest date picker code ( revision 42:
http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/scripts/jquery.datePi
cker.js
)? Do you have a URL demonstrating the problem?

Cheers,

Kelvin :)

Original comment by kelvin.l...@gmail.com on 8 Feb 2009 at 7:23

GoogleCodeExporter commented 9 years ago
I've just added a new plugin for the datePicker (in r50). You can see it in 
action here:

http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerMultiMonth3
.html

As you can see, with datePickerMultiMonth it is easy to create (inline) date 
pickers
that span multiple months... This also works with selectMultiple and with the 
new
numSelectable functionality.

Let me know what you think,

Kelvin :)

Original comment by kelvin.l...@gmail.com on 9 Feb 2009 at 6:18

GoogleCodeExporter commented 9 years ago
Very nice

Original comment by teamwen...@gmail.com on 9 Feb 2009 at 5:40

GoogleCodeExporter commented 9 years ago
I'm just going through the open issues preparing for the next release of my
datePicker and I noticed that this issue was still open. I've made further 
progress
on the multimonth picker and that progress is being tracked in issue 54 - please
watch that issue if you want to see further progress,

Thanks,

Kelvin :)

Original comment by kelvin.l...@gmail.com on 5 Apr 2009 at 7:44

GoogleCodeExporter commented 9 years ago
Hi kelvin,

 I have implemented multi month calendar using your plugins. But its not working
properly, its giving too much of recursion error and initially its showing only
December month of 2999 only. Please check it and could you send me the fixed js.

Original comment by poovaras...@gmail.com on 24 May 2010 at 6:26

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the report. I can duplicate your issue on
http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerMultiMonthP
opup.html
in the latest Firefox. I will try to investigate ASAP...

Original comment by kelvin.l...@gmail.com on 24 May 2010 at 9:26

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hello Kelvin,

I too will await an answer for trouble on 
http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerMultiMonthP
opup.html

Original comment by hadd...@gmail.com on 7 Jun 2010 at 5:29

GoogleCodeExporter commented 9 years ago
Hi,

I would recommend trying with an older copy of the datepicker code as this was 
working correctly at one point. I'm afraid I am too busy right now to 
investigate a fix but you can check out old versions of the code from the 
subversion repository here. When you find the one which works you should be 
able to find the change that broke things. If you can do that then let me know 
and I might be able to fix it quicker,

Thanks,

Kelvin

Original comment by kelvin.l...@gmail.com on 8 Jun 2010 at 8:08

GoogleCodeExporter commented 9 years ago
Issue 197 has been merged into this issue.

Original comment by kelvin.l...@gmail.com on 8 Jun 2010 at 8:20

GoogleCodeExporter commented 9 years ago
Kelvin, 

Thanks for the recommendation. I found that commenting out line 183, 
$dpmm.trigger('dpMonthChanged', [newMonth, newYear]), fixes both issues 
described above. I went back to version r87, then added back in line 196 and 
lines 216-221. Works like a champ! Hope this helps you resolve the latest 
version and fixes issues on the demo page.

Thanks,
Elizeo

Original comment by hadd...@gmail.com on 9 Jun 2010 at 3:48