kelvinluck.com

a stroke of luck

jQuery date picker

My jQuery datepicker is a jQuery plugin which allows you to easily add “date picker” calendars to you HTML forms. These calendars make it much quicker, easier and less error prone for people to input certain types of dates.

Examples

There are full examples of many different use-cases for jQuery date picker all available from the datePicker homepage.

Version

The jQuery datepicker plugin is currently at version 2.1.1.

You can keep up with all changes to the date picker using the project feeds from the plugin’s googlecode page.

Download

The date picker plugin has it’s own googlecode site - this is where the latest sourcecode and releases can be downloaded from. The latest release will always be a featured download and the cutting edge code will be found in the svn trunk:

http://jquery-datepicker.googlecode.com/svn/trunk/

Previous releases will be tagged in the Subversion tags directory:

http://jquery-datepicker.googlecode.com/svn/tags/

Bug reporting and feature requests

Please submit any bug reports or feature requests through the issues list on googlecode. Please remember to include all information necessary to replicate the bug, including effected browser and operating system and a URL to a test page displaying the problem. Please also first search through the issues list to see if there are any existing related issues.

Donate

The date picker plugin is completely free and open source. However, if you find it useful and you would like to make a donation towards my beer fund then please use the paypal button below to donate any amount. Thanks!


213 Comments, Comment or Ping

  1. ted

    hey! awesome work on that Jquery calendar picker!

    if you could select a time with it... then i would say it's complete :-)

    any thought on that? i'd be happy to test, i want to integrate that into Drupal as a new module to get rid of the clunky JSCalendar class

    August 25th, 2006

  2. Hi ted,

    Thanks for the feedback. Unfortunatly at this time I’m not planning to add a time picker to the date picker simply because most use cases I can think of for a date picker don’t also need a time picker. I feel it would be better implemented as a seperate plugin…

    Cheers,

    Kelvin :)

    August 29th, 2006

  3. Hi! Thanks for the great plugin! Is it possible to show days outside the current month, eg. last few days of previous month and first few days of next month

    September 4th, 2006

  4. Hi,

    Glad you like it :)

    It isn’t possible to show the days outside the current month without modifying the core code. I’m busy with other stuff at the moment but will put this on the “todo” list,

    Cheers,

    Kelvin :)

    September 4th, 2006

  5. John H

    Like the simplicity of your plugin.

    If you get a chance to add a time picker I’d definately switch to your plugin over my current date plugin DHTMLCalendar

    September 19th, 2006

  6. thanks for contributing this great plugin to the community, and thanks for not bloating it up with unneccessary features!

    September 20th, 2006

  7. Hi, very nice plugin… exactly what I needed! Except I can’t get the calendar to popup. I’m getting the calendar icon to appear… and have initialized the calendar by following your directions but nothing yet. I’ve tried the posted source and the source from svn. Any ideas?

    September 26th, 2006

  8. Cool plugin. I have my input box to the right of the screen, when I click the calendar icon the calendar opens to the outside of the window’s viewport. How can I reposition the calendar so it is to the left of the input box.

    September 26th, 2006

  9. Hi guys,

    Glad you like it…

    @Matt – does it work on my demo page for you? What browser / os are you using?

    @Mike – I plan to add in some code to a future version which will automatically make sure the calendar is visible. For the meantime you will need to edit the CSS for div.popup-calendar (line 64 of styles.css). Unfortunately you will also have to edit the JS for IE – see line 197 of datePicker_source.js

    Cheers,

    September 26th, 2006

  10. Yes it does work on the demo page!? I’m using Safari and Firefox. Any ideas?

    – matt

    September 26th, 2006

  11. Hmmmmm – no!

    Have you got a version of your test page online somewhere I can see? Have you put all the CSS and JS on your site?

    Cheers,

    September 27th, 2006

  12. Hi Kelvin,

    Cheers for that, it works better if you take line 197 out and then feed IE6 a specific style for the ‘right’ (as opposed to left) position using conditional comments :)

    October 3rd, 2006

  13. Hi Mike,

    Good idea. Like I mentioned above, when I get a chance I’m going to look into making the calendar position itself more intelligently and hopefully at that time I can figure out why IE is misbehaving…

    Cheers,

    October 3rd, 2006

  14. Daniel Hopper

    Its looking great.

    Also, it may be a good idea to allow for year switching as well.

    October 5th, 2006

  15. hi, first sorry for my english, really is to bad.

    if i want too preselect a date (for example if the date is provided from a database), i put the date in input field, but if the date is one or more months older than actual month it does not work.

    how to preselect any date…?

    October 14th, 2006

  16. Hi,

    You should be able to preselect any date but if you want the date to be in the past you need to make sure you have passed in a startDate in the past when you initialise the date selector,

    Hope that helps,

    October 14th, 2006

  17. was playing around with your date selector. love it but it didn’t do every thing that I wanted (allow dates in the past, allowed user to jump forward/backwards in year increments) so I modified your source file email me and I’ll supply you the changed file which you can then diff.

    thanks for such a easy way of adding date functionality to a web site.

    October 17th, 2006

  18. Hi Adrian,

    Thanks for the feedback. It’s a common misconception that the date picker doesn’t let you pick dates in the past but you easily can by passing in a suitable ‘startDate’. I need to update the demo pages when I get a second so there is one that makes this more explicit.

    I’ll get in touch with you re. seeing your changes for the year increments and will think about integrating them when I get a second (very busy at the moment!),

    Glad you like the date picker,

    Cheers,

    October 18th, 2006

  19. Jon

    Great plugin, does exactly what I need. Thanks!

    I also need a calendar to embed into a page to provide navigation around an events listing. Is it possible to embed the datepicker’s calendar straight into a page, by passing the input box?

    October 25th, 2006

  20. Any chance you could extend the plugin to be able to disable days? For instance, disable all saturdays and sundays, or disable the first wednesday of each month? I think that would really help make it more customizeable.

    November 1st, 2006

  21. john Slisbaum

    could not figure it out myself but it would be nice if the iframe was created with the propperties frameborder=0 something like $.IFRAME); so that the css still validates meaning not have to use the filter:mask();

    November 2nd, 2006

  22. Hi guys,

    @Jon – At the moment it doesn’t work like that but I’ll consider it when I next get a chance to do some work on the plugin (which won’t be for a couple of weeks at least!)

    @refactored – Good suggestion but unfortunately the same answer as to Jon – I’m too busy at the moment to implement it but will try to ASAP.

    @john – Another good suggestion and one that’s already on the TODO list. The IE no select hack should be added in with JS rather than being in the stylesheet and this will be done when I next work on the plugin…

    Thanks for the feedback everyone, sorry I don’t have the time right now to integrate the ideas…

    November 2nd, 2006

  23. Jud B.

    Hi. This is fantastic!

    I’m wondering though, how to get the value of the input field after the date is chosen from the picker.

    thanks!

    November 13th, 2006

  24. Jud B.

    BTW, I can access the field using “onchange” but only if I type the date in. I would like to know what the event call is after choosing a value from the datePicker.

    Thanks!

    November 13th, 2006

  25. Hi, glad you like it :)

    It depends what you want to do with the value in the input field. The normal usage would be to submit the form and then the date will be available to your serverside script.
    Or you could grab the date back out using jQuery and do something with it:

    $(’#your-input-id’).val()

    Should do it…

    Hope this helps,

    Kelvin :)

    November 13th, 2006

  26. Jud B.

    Heh. Basically, I’m trying to use an AJAX call to update a text area field w/ database content. That DB content requires a date parameter and so I wanted to use the datePicker. :)

    Right now, if a user types in the date (11/14/2006), then the “onchange” event calls the JS function which makes the AJAx request to the db and then displays it in the text area.

    This then allows the user to proofread or edit the text for that chosen date. Once approved or changed, then they hit submit and updates the DB.

    So, really I guess what I need to know is if there is an event handler for the datePicker.

    Thanks for any help! :)

    November 13th, 2006

  27. Hi Jud,

    Sorry – I misunderstood you originally… Now that I understand you I just did a quick change to the date picker source which makes sure that the INPUT’s onchange event is triggered when a date is selected. Check out the plugins page again to grab the update (note that the packed version isn’t up to date because Dean Edwards packer is currently unreachable).

    Hope this helps,

    Kelvin :)

    November 13th, 2006

  28. Jud B.

    Fantastic! Thank you so very much for going out of your way to do this!

    I’m sure there are other devs who’re going to love this!

    November 13th, 2006

  29. kevin

    hey! Love this calendar! Works great, but I don’t see the icon. Using IE6 on XP.

    Does it matter if I have the icon in an images folder? I’ve modified the CSS to: images/calendar.png, but it’s not showing. any ideas?

    November 15th, 2006

  30. Hi :)

    It doesn’t matter where the calendar image is, you just need to make sure it is referenced correctly in the CSS . Bear in mind that the path to the image in the CSS is relative to the CSS file, NOT the HTML file.

    Hope that helps,

    November 16th, 2006

  31. kevin

    I do have the correct path to the images because when I remove “no-repeat” it appears. Also, I don’t have a link when I publish the file online. Offline, there’s still no icon, but at least I can hover in the right area, see the cursor change and click. Online, none of that. Any ideas?

    November 16th, 2006

  32. Hmmmm – I’m afraid I’ve got no ideas. It sounds like something in your CSS is clashing with something in the calendar CSS… Is your calendar field in a table cell? Someone else had some issues with that – does that help you at all?

    Cheers,

    November 16th, 2006

  33. kevin

    I’m sure it’s a CSS error so I’ll have to tinker with it. It’s not in a table (I don’t use them anymore! :D )

    Thanks again!

    November 16th, 2006

  34. Hi Kevin,

    great plugin, ive included in a open sourec app im working on (www.simpleinvoices.org), just wondering are there any plans to add an option to move forwared/backwards by years as well as months

    Cheers

    Justin
    justin@kelly.org.au

    November 16th, 2006

  35. Emilio

    jquery datepicker: I’d like the starting day of the week to be configurable. Here in europe it’s rather monday than sunday. Otherwise great ;-)

    November 17th, 2006

  36. Hi guys – thanks for the feedback…

    I’m hoping to do some work on the plugin at some point soon and will definitely integrate the week start request. I’m still personally not sure if the jump by years functionality belongs in the plugin but it has been requested many times so I’ll try and add it in…

    Cheers,

    November 18th, 2006

  37. Hi Kelvin

    I am adopting jQuery as my JS Framework and would love to use your calendar for the booking forms on my site. However, I am forced to use 3 select fields for the date (1 each for day, month and year) because it submits through to a 3rd party reservation system. I was wondering if your date picker could be configured to work using select fields like mine?

    Thanks
    Mike

    November 21st, 2006

  38. Hi Mike,

    It’s not currently possible to do that with the date picker. It would be a nice feature though and I’ll stick it on the TODO list for when I next get a chance to work on it,

    Cheers,

    November 22nd, 2006

  39. Arthur

    Hiya all,

    I too am loving this plugin – there is, however, one issue I’m trying to solve and maybe I’m just not looking well enough. I’m hoping you can help me on this one.

    When I apply the date selector to an input, the size of the input (which is padded in my layout) resets and – being a perfectionist – I was wondering if there’s any way of keeping exisiting styles. I’ve looked into the CSS and deleted every line where it says padding: 0 or margin: 0 and (surprisingly) not much happened.

    Any ideas would be greatly appreciated ;)

    December 3rd, 2006

  40. Anders

    Here’s a vote for keeping the plugin lightweight and not adding too much features.

    A bit related to lightweight: paging months is a bit “sluggish”. Any ideas on how to improve the speed of _getCalendarDiv()?

    December 4th, 2006

  41. @Arthur – glad you like the plugin and contacted me direct to let me know you figured it out and started editing the right CSS!

    @Anders – glad you agree about keeping the plugin lightweight. Not sure why it feels sluggish to you – I guess we could investigate creating the calendar popup once and then updating the fields within it rather than recreating it from scratch each time but I’m not sure this will help…

    December 4th, 2006

  42. Anders

    I used the brand new Firebug 1 beta “Profile” feature, which showed that both changeMoth and _getCalendarDív averaged around 150ms. I’m not sure if you add them or not to get the “real” value. Anyhow, when clicking fast through the months, I can clearly feel a lack of responsiveness, it’s not huge, but still there. I compared that with the google calendar version which feels more responsive, and it seems to average around 30ms (not so obvious there which functions are being called).

    December 4th, 2006

  43. Anders

    Nevermind the thing about adding the two times, it’s of course only one that counts as changeMonth calls getCalendarDiv…

    December 4th, 2006

  44. I’ll try and take a look into speeding up _getCalendarDiv when I next get a chance to work on the datePicker and I’ll take a look at how the google calendar one does it (btw – where can I see that?),

    Cheers,

    Kelvin :)

    December 5th, 2006

  45. Anders

    http://google.com/calendar -> “Create event” :)

    December 5th, 2006

  46. Cheers :)

    December 6th, 2006

  47. Laplix

    Any chance we could have multiple dates selection?

    Right now, I am using Dynarch Horizontal Menu which does that.

    I //would love// dropping this library and use only jQuery. But I need this functionnality.

    Your plugin is awesome and I would replace hmenu right now if I could.

    I have to thank you. Not only is it very useful, but I learned a lot with it. Thanks again.

    December 27th, 2006

  48. Hi,

    I guess you mean the Dynarch Calendar (not menu)?

    There are a number of improvements I have planned for the date picker but to be honest I think multiple date selection will be at the bottom of the list…

    The problem is that it is quite a fundamental change as a date picker is currently by definition attached to one INPUT field and it would be an issue adding multiple dates to one field…

    If there are enough requests for it (and I get enough time!) then I will consider adding it though…

    Glad you like the plugin,

    Kelvin :)

    December 28th, 2006

  49. This is indeed a great datepicker. I would also like to put in a request in for a way to embed the calendar in the page, instead of popping up.

    Keep up the great work!

    January 10th, 2007

  50. Dan Moran

    A superb date picker and easy to customise. It saved me a large javascript headache with some legacy code. If you want to style the inactive table cells further you may have to change the empty string to a non-breaking space so IE renders it properly.

    January 12th, 2007

  51. Gyulus

    Hi Kelvin, I use your nice stuff on a site.
    But (maybe you know) it doesn’t work with the new 1.1 beta version of jquery.

    January 13th, 2007

  52. zach

    I’ve ben using jscalendar, and then I recently discovered jquery and would love to consolidate all of my disparate js effects and tools into the framework. Is there any chance that there will be an update to datePicker in the near future? I’m looking specifically for a couple of features that have already been mentioned:
    -move by year (via dropdown for distant year values)
    -optional time selection

    jscalendar has a boatload of additional features, but the ones that I’d be hoping for are:
    -more configuration options for returned date/time format
    -allow user to move the DIV

    January 15th, 2007

  53. Gyulus

    Hi Kelvin!
    I hope, soon you will update your great datepicker to work with the new 1.1 version of JQuery.

    January 15th, 2007

  54. datePicker appears not to work against jquery 1.1.

    January 15th, 2007

  55. Hi. Great date picker.

    However, it may have broken for jQuery 1.1

    I’m trying to use it with the latest jQuery and I get the following error:

    _firstDate has no properties

    on line 79 in uncomprssed datePicker.js

    I haven’t looked too closely for the reason, as I still not too sure what to look for in jQuery :) But the problem is there :(

    January 17th, 2007

  56. Is it compatible with jQuery 1.1?

    January 19th, 2007

  57. I’ve just updated the date picker and it is now compatible with jQuery 1.1 (I had to work around a bug in the jQuery core),

    Cheers,

    January 21st, 2007

  58. you can’t chain methods on the datepicker after setup, since its not following JQuery conventions. a ‘return this’ fixes this:

    diff—git a/s/jd.js b/s/jd.js
    index ec3ecab..d5b163f 100644—- a/s/jd.js
    +++ b/s/jd.js
    @ -407,7 +407,7 @ jQuery.fn.datePicker = function(a)

    jQuery.datePicker.setInited(this);
    }
    }); – +return this;
    };

    January 21st, 2007

  59. Olivier Jacquet

    In IE7, if you pick the left picker on the demo page, the input fields shows through the calendar.

    January 23rd, 2007

  60. Gyulus

    Thank you for the new version!
    You forgot to update the LastChangedDate field in the source:
    $LastChangedDate: 2006-11-26 17:52:59 +0000 (Sun, 26 Nov 2006) $

    January 23rd, 2007

  61. @carmen & Gyulus – thanks for the headsups, I’ve now added these in.

    January 23rd, 2007

  62. Hi Kelvin,

    i would too love the “multiple dates” functionality: it’s very useful for theatres and cultural places, where content administrator needs to enter all the dates for one show. in fact, you would use the calendar to fill in the value for a hidden input field, returning a string with all dates separated by, say, a semicolumn.

    January 28th, 2007

  63. Jacques

    I think that have a bug when serving jquery date-picker as xhtml (xhtml1-strict with php headers). header(“Content-Type: application/xhtml+xml; charset=utf-8”); Firebug 1.0 return: An invalid or illegal string was specified” code: “12” Serving as text/html dont´t have problem… Tks for excelent script!

    January 28th, 2007

  64. Hi Kelvin,

    Great plugin. I ran across an issue with setting the start date:

    $(’#date_chooser_date’).datePicker({startDate:’11/11/2006’});

    For whatever reason, the start date is ignored, and any start date is selectable

    thanks,

    Mike

    January 29th, 2007

  65. Fei Yang

    Hi Kelvin,
    can you give an example to call selectDate(d, ele) on datePicker? I don’t which I should pass to ‘ele’ parameter

    January 30th, 2007

  66. Hi guys – thanks for the feedback.

    @ Alexandre – maybe this is a problem that could/ should be solved in the page. So once a date is selected an extra input field with datePicker is dynamically added to the page. Rather than adding code to deal with this directly into the plugin (which I want to keep lightweight)?

    @Jacques – this is probably because the calendar elements are created via jQuery which uses innerHtml which isn’t allowed in true XHTML. There was an interesting discussion about that on the jQuery mailing list today – the conclusion seems to be that the world isn’t yet ready for pages served as true XHTML.

    @Mike – I can’t replicate your problem. startDate sets the first selectable date. So the user should be able to select any date between that and endDate. Is this different to what you are seeing?

    @Fei Yang – I’m not sure what you are trying to do. That is an internal private method. If you want a different date to be selected in the pop up calendar simply put that date into the input field and it will automatically be selected in the calendar when the calendar pops up,

    Hope that all helps!

    February 1st, 2007

  67. hi Kelvin!

    other question: i get the input date from mysql, which has a built in command for outputting it the way i need (date_format(mydate,’%d-%m-%Y’))
    but mysql does not have a built in function for formatting the date back to mysql format on INSERT/UPDATE.

    question: wouldn’t be useful that the plugin allows to set the input date format (dmy) and the output date format (Y-m-d) ?

    thanks for the great plugin !

    February 7th, 2007

  68. Hi Alexandre,

    Why not use:

    $.datePicker.setDateFormat(‘ymd’,’-’);

    (example from the “usage” section of the plugins page)?

    Hope that helps,

    February 7th, 2007

  69. Mark Mazelin

    We’re trying to make the switch from jscalendar to this great jquery calendar. One big issue is that we need to limit the dates; more than just start and end dates. As in jscalendar, I want to be able to pass a custom function during the init and have it run when each day is being output to determine whether or not to show the date. That will allow arbitrary date selection criteria, such as every Thursday, no weekends, etc. I attempted to modify the code, but couldn’t get the function to be defined within the object (I’ve never written a jquery plugin before). Any ideas or help or plans for the future?

    Thanks,
    Mark

    February 8th, 2007

  70. Hi Mark,

    I really like the idea of an optional custom callback function which could be run for each date output. This would allow a great deal of extensibility without making the plugin too heavy… It could simplify the plugin itself as well by abstracting out some of the logic which is stuck in the dates loop. I’ll look into this when I next get a little bit of spare time…

    Cheers,

    February 8th, 2007

  71. Mike

    Kelvin,

    Thanks for the work you’ve done here.

    I have a setup where the user enters a start date and an end date. I’d like the end date calender to default to the month of the date set in the start date field (sorry if that’s confusing). This might have the same solution as mentioned above with adding a custom callback function. Is there a way to accomplish what I’m trying to do now?

    February 8th, 2007

  72. Hi Mike,

    This is a normal use of the date picker and I would like to add some code to make it easier… At the moment I’m totally snowed under though :(

    In the meantime, you can listen for the “change” event on the first textfield and can use this event to copy the value from the first field into the second field. Then the second calendar will have the first chosen date selected when it’s first popped up…

    Hope that helps,

    Kelvin :)

    February 12th, 2007

  73. Hi Kelvin.

    Great plugin! I just have a suggestion for it: check if the related input is enabled before opening the calendar. I made a patch like this on the show method:

    if ($(input).is(’:disabled’)) {

    return;
    }

    February 19th, 2007

  74. Mark

    Hi Celsius, ummm, I mean Kelvin! :)

    Great date picker! Only one small problem: I can’t get a label text to appear in front of the input box. I must be missing something. Any ideas what?

    Thanks and regards from Slovenia

    February 21st, 2007

  75. Tom Kentell

    Hi Kelvin

    Having a problem with the datepicker which someone else mentioned previously but when you open the datepicker it shows through input boxes and table cells, this only happens in ie though (5.5, 6, 7) any ideas?

    Thanks, Tom

    February 22nd, 2007

  76. Hi Guys,

    @Nando – nice idea – I’ll add this in.

    @Mark – not sure I understand your problem… You mean you can’t figure out the CSS to get a label sitting infront of the input? Maybe because the input gets wrapped in a div class “date-picker-holder”?

    @Tom – Hmmm – you shouldn’t be having this problem. There is code in the plugin to prevent this happening. Do you see it on my demo page?

    Cheers,

    Kelvin :)

    February 22nd, 2007

  77. Mark

    Hi,

    yes, I can’t figure out the CSS to get a label sitting infront of the input. Can you help me with this one? Pleeese!

    February 22nd, 2007

  78. Tom Kentell

    Hi Kelvin, thanks for the quick response, i checked on the demo page and in IE your calendar is also being covered up by the text box, i think someone mentioned the problem before but dont think you answered it, its a problem which might not actually be fixable with the current setup on the page but if you can help it would be much appreciated, thanks, Tom.

    February 22nd, 2007

  79. Tom Kentell

    Hi kelvin, have sorted the problem it was the containing div, had set zoom 1 to fix an issue with the height of a bar but that was causing the calendar to fall behind certain things but have fixed it now

    February 22nd, 2007

  80. Olivier Jacquet

    Isn’t anyone else having this IE7 problem where the input text field shows through the calendar? Here it shows through for everyone.

    February 22nd, 2007

  81. Hi,

    @Mark – does maybe floating the label left help? Check out the styles on “date-picker-holder” – maybe you’ll need to tweak them too…

    @Tom – glad you figured it out – I was confused because it works fine in IE6 here…

    @Oliver – I haven’t got IE7 here so I’m not sure but the problem has been reported to me before. I thought someone had solved it but I can’t find the details at the moment. I’ll try and test on IE7 when I get a chance, in the meantime I’d appreciate any suggestions…

    Cheers,

    Kelvin :)

    February 22nd, 2007

  82. ccc

    yes… custom callback sounds good. then we can create one for ISO8601 date format

    February 23rd, 2007

  83. ethan

    It’s a great plugin, thanks.
    if there is a year switching function would be better.

    would someone share this part before kelvin working on it?

    February 26th, 2007

  84. Hello Kelvin,

    great work on the plugin, it won’t render properly in IE 6.0 on linux (IE4linux), it works great on firefox though…

    February 26th, 2007

  85. Mr. Wilson

    I would like to echo the earlier requests for multi-date selection capabilities.

    Great work!

    February 26th, 2007

  86. Adrienne Travis

    I am also having the issue in IE 6 and 7 where the calendar displays behind all other elements (in my case, behind select boxes, input elements, horizontal rules, EVERYTHING). Have tried mucking with z-indices, and nothing works. If necessary i can send over a reduced test case.

    Adrienne

    February 26th, 2007

  87. font sizes and style etc

    I had a problem with the calendar showing up perfectly at first, but as soon as I click next to change months the style changes and the Saturday column is partially missing. I’m using the Yahoo YUI fonts, resets and grids css plus some other css I’ve put together. I wouldn’t think it’s interfering, but maybe that’s the case. I jsut adjusted some font sizes, and padding etc and now it works. Any ideas?

    Great plugin—super simple!

    February 28th, 2007

  88. Hi guys,

    I can’t replicate any problems in IE6 on my test page on multiple machines here. Do you have a standalone version of IE6 running alongside IE7? I’m afraid I know nothing about IE6 on linux but I’d probably use firefox on linux anyway!
    Re. the style changes used alongside YUI fonts, resets and grids, I’m afraid I have no idea. I guess the CSS must be clashing in some way – if you have an example page I can take a quick look?

    Cheers,

    March 1st, 2007

  89. Chag

    Hi,
    Your date picker is great and so easy to install.

    Just noticed 2 problems.
    1) the linux problem (when you click fast) seems to be still there

    2) Could it be possible to have dropdowns to select month and year ? I need to select dates in the next year (2008).

    Good job.

    Chag

    March 5th, 2007

  90. Hi Chag,

    Both of those issues are on the TODO list but it’s a question of finding time to do them! I’ll post here when I get round to it…

    Cheers,

    March 6th, 2007

  91. santy

    Hi,
    I am facing a problem with IE6,a part of the calender date picker is displaying behind the dropdown control.Hope i am clear please slove my problem.

    March 6th, 2007

  92. Hi Santy,

    You are one of a number of people reporting the problem in IE6 but I can’t replicate it on any of the computers I’ve tried. What exact build of IE6 is it? Have you done a windows update recently or something? Is it happening on my demo page?
    Thanks for any help tracking this down,

    March 6th, 2007

  93. Jon Henning Bergane

    Is it possible to use it without a date separator? I’m using a DB date-format like yyyymmdd with no separator. Seems it defaults to / when I try to specify blank.

    March 6th, 2007

  94. Chag

    jon : look at the source, there’s a line a the beginning :
    dateSeparator = ”/”;
    try to remplace with
    dateSeparator = “”;

    March 7th, 2007

  95. René Leonhardt

    Dear Kelvin,

    Great plugin, thanks for contributing it!

    I have a feature request for startDate:
    allow values like ”+1” or ”-3” (today + 1 day or today – 3 days).

    Best regards,
    René

    March 9th, 2007

  96. Slawek

    Dear Kelvin,
    I’ve a problem with your plugin when try to use it with niceJform plugin. When used together the small calendar link-image is on the right of textinput, but then the text input style is messed up. I figure out, that when I change in calendar css this:

    div.date-picker-holder input {float:left;}

    into this:

    div.date-picker-holder input {float:none;}

    the textinput looks fine. But the small image-link jumping down, below the textinput. Any help would be great!
    Best regards

    March 14th, 2007

  97. xema

    Hi Kelvin,

    I’m trying to use datePicker as a calendar only (allways opened, no date selection…). Do you know if there is some done work in this topic?

    Btw, I was experimenting the problem with IE about images and widgets that appear through the calendar (http://www.nocaduca.com/dp/test_datepicker.htm). I have testing (in firefox everything is ok) and i should take out a position:relative in the img.. but is this the point? I need that position:relative :(

    March 15th, 2007

  98. xema

    Hi again…

    I fixed the problem with IE taking the position:relative out, eventually.

    But in the former question (about using datePicker as a calendar), I can’t get by on showing the pop-calendar without throwing any event! Is it jQuery.datepicker.show(this)? this.datepicker.show()?... :(

    March 19th, 2007

  99. Laurent Chardin

    Hi xema, how did you manage to solve the problem with IE ? i have the same problem with images overlaping the calendar (in IE7). I have the problem on kevin’s test page too : http://kelvinluck.com/assets/jquery/datePicker/

    March 22nd, 2007

  100. Laurent Chardin

    Actually, on kelvin’s test page, when i open the Date 1 calendar, i can see Date 2 input and image through it…

    I’m using IE7

    March 22nd, 2007

  101. Hi,

    I finally managed to borrow a laptop with IE7 on it and fixed the IE7 “see through calendar” bug. Check the demo page and the source files (note that there were changes in the CSS as well as the JS files – see all changes here)...

    Cheers,

    Kelvin :)

    March 22nd, 2007

  102. Shelane

    Can it be modified to allow and start date in the past?

    March 24th, 2007

  103. Hi Shelane,

    I’m not sure I understand. You can pass whatever dates you like in for startDate and endDate (see the example on my page),

    Hope that helps,

    Kelvin :)

    March 25th, 2007

  104. Shelane

    What I mean is that I’d like to not have to pass end a start date the way you don’t have to pass an end date to allow it to go on forever. I’m not sure how far back my users might need to enter information for (their birthday for instance). I suppose at worst I can go back 100 years.

    March 27th, 2007

  105. Hi Shelane,

    Ahh – I see. For me a much more common use case is in booking something (flights, tickets, whatever) where it is necessary to only be able to pick a date in the future. That is why I decided that no startDate means that today is the first available day.

    I don’t think the datePicker is a great tool for selecting birthdates or any other day far in the past or future (due to the amount of months you need to click through to get there) so I don’t think that a “no first date” ability would be that useful. As you say, you can pass in a date hundreds of years in the past which should be sufficient,

    Cheers,

    Kelvin :)

    March 27th, 2007

  106. Rene L.

    Dear Kelvin,

    I have the same showthrough issue with IE 6/Win and the current and previous datePicker version (datePicker laps over TinyMCE toolbar buttons), z-index didn’t work either.

    My feature requests:

    1) setChooseDateStr(newTitle).

    2) Hooks after _closeDatePicker() and before show().

    Best regards, greetings from Germany,
    René

    March 29th, 2007

  107. Oleg Ovchinnikov

    Hi Kelvin! There is a bug in datePicker, concerned with ssl. If you access the site over https, at the time of the first use of calendar (first clicking on it), you get IE security alert “This page contains secure and non secure items”.
    Best regards,
    Oleg

    March 30th, 2007

  108. Hi,

    @René – thanks for the feedback. I’m currently specifying a new version of the date picker with the help of Jörn Zaefferer, Paul McLanahan and Brandon Aaron and will take these observations into account. It will be started from scratch and should hopefully add new functionality and clear any old bugs :)

    @Oleg – thanks for the report. I don’t currently have access to a https server so can’t test – could you edit line 198 of datePicker_source.js to read:

    if (false && jQuery.browser.msie)

    and let me know if you still get the error? (this will allow selects to shine through the date picker but I’d like to know if this block is causing the problems so I can take it into account for the new version),

    Thanks,

    Kelvin :)

    April 1st, 2007

  109. This is wonderful and lightweight. My only complaint is the need to use the icon. I would really like it if I could have the option of having it popup when the user clicks (tabs?) into the date box.

    Thanks for all your work, you have made my life easier.

    April 3rd, 2007

  110. Hi Donovan,

    Glad you like the date picker :)

    There is already a (undocumented) option to have the calendar popup when an input is clicked on rather than the calendar – just pass inputClick:true in when you initialise your date picker. e.g.

    $(’#input-id’).datePicker({inputClick:true});

    Hope that helps,

    Kelvin :)

    By the way, I’m just about to go on holiday for a week – when I get back I will be finishing up the rewrite of datePicker.

    April 3rd, 2007

  111. Oleg Ovchinnikov

    Hi Kelvin!
    Yes, you’re right. Security alert is caused by iframe.
    Could you please email me if you have ideas about solving this problem?

    Best regards,
    Oleg

    April 4th, 2007

  112. Chris

    For those of you needing year selection…go here:
    http://codetale.com/2007/02/23/javascript-calendar-widget

    I would rather use a jquery plugin but this will do the job for now.

    April 4th, 2007

  113. Seth

    Thanks for this, I love jquery, this is another great plugin.
    I had to comment out line 258 to get r1566 to run.

    April 4th, 2007

  114. Oleg Ovchinnikov

    Hi again!

    Kelvin, let me propose a solution of “IFrame vs. SSL” issue to you.
    “The warning message occurs because Microsoft Internet Explorer is unable to determine if the SRC attribute of the IFRAME is secure or unsecure.” (http://support.microsoft.com/kb/261188)
    So I just added the SRC attribute to IFrame (Line 201 of datePicker_source.js):

    iframe src=”javascript:false;”

    Construction like

    iframe src=”//0”

    doesn’t solve the problem, because in such case the security alert occurs on clicking “Next” button on calendar.

    Thank you for your great work. Best regards,
    Oleg

    April 5th, 2007

  115. I am having a hard time getting select elements with the multiple=”multiple” attribute not to show through the calendar. Is this a known bug?

    April 5th, 2007

  116. Oleg Ovchinnikov

    Hi Kelvin!
    One more bug in datePicker :)
    SELECT displays through the BORDER of calendar. For example, change the background color of the example page and you’ll see.

    April 11th, 2007

  117. Tony Raitano

    Re: Security alert and iframe. Whenever I have seen that problem, the iframe’s src attribute has been defaulted to about:blank. To eliminate the security alert we default the src attribute to blank.html which is just an html page with an empty body. I’m not sure if that will help in this case but it has worked for us in the past.

    Good Luck,
    Tony

    April 11th, 2007

  118. Hi,

    @Chris – or if you can wait for a little while then hold out because year selection will be available in datePicker v2 which is currently being worked on…

    @Seth – thanks for the headsup. I’d left some debugging code in there. Although the problem wouldn’t have effected most people because if you are running firebug or window.console == undefined (e.g. as it normally would be) then there would be no problem – it must have been conflicting with some other logging solution you are using on your page?

    @Oleg – thanks for the further investigations. I’ve updated the plugin to set the src for the iframe to a blank.html page I’ve created as suggested by Tony – does that help?

    @Luke – this isn’t an issue that I’ve run into before. In fact, I can’t replicate it on IE6 – do you have the problem on this page?

    @Oleg (again!) – thanks for the headsup re. the border. I’ll see if there is anything I can do about this in v2 of the datePicker.

    Thanks for all the feedback guys,

    Kelvin :)

    April 12th, 2007

  119. Oleg Ovchinnikov

    Hi Kelvin!

    1) r1672 – Yes, I tried the construction like
    iframe src=”blank.html”.
    That really works but we need an additional dummy page :(. So I use the construction src=”javascript:false;”.
    Please, notice that I’ve tested it under IE6 and Opera 9.02 only.

    2) Do you already have a working solution of the border problem? Can you public the approximate date of v2 release?

    April 16th, 2007

  120. Hi Oleg,

    1) Do you still get the security error on clicking the “Next” button with the iframe src=”blank.html”?

    2) No solution for the border problem I’m afraid. Are the borders essential to your design? You could just remove the borders…

    As for a release date for v2, I’d hope to have a beta version publically available in the next few days.

    Thanks,

    Kelvin :)

    April 16th, 2007

  121. sylvain261

    Would be great to have the week number optionally displayed on left of each weeks.

    April 16th, 2007

  122. Seth

    Kelvin,
    Yes that is what I thought about your debugging code. The problem happened in IE6 and Firefox (w/ Firebug). I am working within the BEA WebLogic console, so BEA may have something else that is going on causing the conflict? I am not using any logging directly, but that is a problem with this portal development, I never know what is affecting my portion of the page, my code or all the other BEA code I cannot control. I am also having trouble with inputClick:true in IE6 and a readonly (yes I am aware that there are other potential usability issues), input but again the problem may be BEA and if so I do not think the benefit of a solution would justify the work.
    Typing of work, thanks for all you have and continue to put into this.
    -Seth

    April 16th, 2007

  123. Oleg Ovchinnikov

    Hi!

    1) No, I don’t. It’s OK.
    2) It’s a pity :( The borders are really essential for my calendar because of the page style…

    April 17th, 2007

  124. @Sylvain –
    Hmmm – this is a new request but I can see how it might be useful. I’ll see if I can allow for it in v2 which I’m currently developing.

    @Seth –
    Very strange. If a console.log call was stopping it from running even in Firefox with firebug the the BEA thing must be doing something very weird! I don’t envy you debugging with weird things like that going on! Good luck :)

    @Oleg –

    1) Cool :)
    2) Hopefully v2 of the plugin will avoid this problem…

    Thanks for the feedback guys,

    Kelvin :)

    April 17th, 2007

  125. Tony

    Thanks for the plugin. One recomendation:
    When I open Calender it is open from left and top position 0 ralative to the picture. In some forms this cause a problem. Good choice will be if we can control this with parameters. Sorry for my poor engish.
    Regards
    Tony

    April 20th, 2007

  126. Hi Tony,

    v2 of the plugin is very nearly ready and allows you to control exactly where the calendar appears (whilst still providing sensible defaults).

    Look out for a beta in the next day or so…

    Cheers,

    Kelvin :)

    April 20th, 2007

  127. misha

    Hi kelvin!
    This is really very cool plugin, I hope v2 will be even better.
    In my recent project I wanted to disable the calendar temporarily but could not find an easy way to do it. It would be good if you would add “disabled” property in v2.

    April 24th, 2007

  128. Hi,

    You can judge for yourself how good v2 is – I announced the beta on the jQuery list this morning…

    Re. the disabled property, that’s a good idea. If the date picker is associated with an input and that input is disabled then the date picker should also become disabled. I’ll look into implementing that,

    Thanks,

    Kelvin :)

    April 24th, 2007

  129. MySchizoBuddy

    Can we have date block feature. Users shouldn’t be able to pick a date before today’s date.

    May 2nd, 2007

  130. Hi MySchizoBuddy,

    That is the default behaviour of both the original date picker and the v2 beta – if no startDate is passed then it defaults to today, otherwise you can set the startDate to whatever you like…

    Cheers,

    Kelvin :)

    May 5th, 2007

  131. Jose

    Hi,
    Great plug-in, congratulations. Sorry if I sound like a newbie, but I tried to set a default value (not the start date) and I couldn’t find how. I just want to have an input field reading the date from a database and to have that value as default. I hope you get what I mean ;-)

    May 8th, 2007

  132. Hi Jose,

    Which version of the plugin are you using? In fact, it shouldn’t matter…

    In either version you can simply put a value into the input field and this will become the selected date in the date picker. So on page load use your database to write the date into the “value” attribute of the input field…

    Hope that helps,

    Kelvin :)

    May 8th, 2007

  133. Declan

    Hi Kelvin,

    First of all, nice work! and i dig the photos on your website, gave me some ideas on my next travel adventure.

    I am playing around with your Start and End Date datePicker demo (http://kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerStartEnd.html) and was wondering.. is it really that neccessary to use so many .js files in order for this to work.

    1. jquery-1.1.2.js
    2. date.js
    3. dimensions.js
    4. jquery.datePicker.js

    and finally..
    5. Page Embedded javascript

    All adds up to a fairly hefty call to the server. Forgive me in advance if this is a dumb question but i am fairly new to javascript and over cautious with page download times.

    respect!
    Declan

    May 16th, 2007