logo

A Nice Little Date Picker

Notes calendar controlAt one point or another we've probably all had to get round the fact that Notes doesn't translate its handy little date pickers to the web. In the past I've used a variety of solutions ranging from Java applets to home-baked modal window approaches. Well, in my continuing quest to provide you with the useful things you all need, I have a nice little DHTML date-picker to demonstrate. As I mature I find my approach to using "fancy" widgets like this changes. Why not stick them in if they're needed? Even if they do require three JS files and one extra CSS resource! If the users are happy that's all that matter.

Let's look at an example. Click on the calendar icon next to the text box below to launch the picker:

Note: You may have noticed the page paused here as said files loaded...

Nice isn't it?! And that's only the trimmed-down "simple" version. You can get really carried away with it and even include a time picker. I've packaged the basic files you'll need in to this simple demo database (Domino 6).

If you want the full code and to see some more variations visit the developer's site. From what I can see it's shareware. Not sure if making a donation means you can remove the "?" icon that displays his personal contact details. Not what you want users of a large corporate system to see...

Did you notice the page pause as it loaded? Refresh and see if it does it again. In total there are 64KB of files required. Whether or not this is an acceptable burden on the page depends on your circumstance. The pause in this case was becuase I've included the files inline with the HTML. Much better is to place it in the header and then only when forms are in edit mode. Hopefully, with you cache settings correct, the effect will be negligible.

Not sure what the browser support for this is. If you find it doesn't work, let us know what you're using.

Comments

    • avatar
    • Doug
    • Fri 25 Jun 2004 06:14 AM

    I've used this calendar before and our clients really liked its UI.

    • avatar
    • Lance Jurgensen
    • Fri 25 Jun 2004 07:46 AM

    Jake, I tested this one a while back and the only problem we found was the double click to get a date. It was frustrating to our users.

    We ended up going with SpiffyCal, another free calendar.

    You can find it here: {Link}

    Not as polished as the one you found, but it seems to work on everything except Opera.

    • avatar
    • Jake
    • Fri 25 Jun 2004 07:57 AM

    Lance. Single click is an option. The default seems to be double though. No idea why! Notice the one above is single-click? Look at the source to see how. Something like:

    cal.singleClick=true;

    • avatar
    • Gaston
    • Fri 25 Jun 2004 07:58 AM

    I used this one for a client, with a lot of success.

    A lot of option, and very easy to integrate, either in popup or not.

    As of the browser integration, IE and Firefox work very well.

  1. Although i like the UI of your example better, this one has got nice month/year selectors ala notes.

    {Link}

    Maybe we should merge the two? ;)

    • avatar
    • Jake
    • Fri 25 Jun 2004 12:09 PM

    "Mine" has month/date selectors too. Just not very obvious. Press down on the arrows to either side of where it says Today to see what I mean. Not obvious but works ok once you know it's there.

    • avatar
    • Tom
    • Fri 25 Jun 2004 02:17 PM

    Hey, my birthday falls on a Friday in the year 2567. Looking forward to a great night out on the town then!

    Like the calendar. Good work Jake.

  2. I've been using this one for a while, and I like its configurability (including "language packs").

    BTW, if you use computed text in the mini-config on your page, you can have Domino throw in a time-formatting string at run time to make sure that what the user selects matches your server settings regardless of who's been playing silly config games or which of your multiple international servers is being hit. Also useful for setting the language pack download based on user prefs.

    • avatar
    • Jake
    • Fri 25 Jun 2004 04:53 PM

    Nice idea Stan. Hadn't thought of that. Something like this? {Link}

    • avatar
    • Andrew Tetlaw
    • Sun 27 Jun 2004 07:46 PM

    Regarding the field "ID" property:

    "For the field this means we need to add "id=\"MyDate\"" to the HTML Attributes of the field!"

    As a rule now on forms for each field I always make sure the name of the field is also in the id field on the HTML tab of the field's info-box. It saves a lot of time and avoids having to escape quotes on html attributes.

    As a side effect the designer client will also not allow you to have more than 1 field with that id value, a handy sanity check given for free!

  3. if you like this calendar but wonder how you could make it display some days in other colors check this

    {Link}

  4. This is a great tool that we're trying to add to our forms. But when we click our submit button (just doing FileSave and FileCloseWindow, also tried using the JS "submit()") the form does not get processed. We can take out the date picker and everything works ok. Any clues?

    • avatar
    • GZH
    • Fri 9 Jul 2004 06:46 AM

    it works on local, but not on server! Any ideas! Please!

    • avatar
    • Robert White
    • Wed 8 Sep 2004 16:20

    I just saw an article for a "pure Domino" popup calendar. While I am very fond of the Mishoo widget, I really like this all Domino solution by Daniel Koffler. The only problem with this solution is that it generates another hit on the web server, but only if someone actually needs to pop open the calendar. The article with the code can be found here: {Link}

    • avatar
    • Mark
    • Thu 28 Oct 2004 07:19

    I don't have domino and I would like to try out this code. How do I begin? I see the only download file here is .nsf file which is a database file. I'm confused?

    • avatar
    • Jake
    • Thu 28 Oct 2004 07:28

    Mark. Follow the link to the developer's site.

    • avatar
    • owen
    • Thu 6 Oct 2005 04:23 PM

    I am trying to convert this back to an R5 database format.

    The .js and .css have all become pages and so on BUT the calendar.setup process does not work.

    Has anyone done this conversion?

    I think it may the calendar-setup.js is trying to do something that is not supported in R5?

    any ideas would be appreciated.

    thanks

    • avatar
    • owen
    • Fri 7 Oct 2005 01:57 AM

    Figured it out - reminds me of doing webdav with R4.5/6...

    Contact directly if you need the details

    • avatar
    • RIPAL
    • Thu 2 Mar 2006 03:06 AM

    i whode like to down lode this datepiker

    • avatar
    • lpang
    • Wed 15 Mar 2006 08:08 AM

    very nice

  5. Hi Jake, just wondering how to add .js files to domino databases. I have another calendar that i use, which also relies on some .gif files for the images and is in a folder. how do i basically include a whole fold in my domino databse. e.i. im also trying this so that i can include Dojo in my database. All iv'e managed to do up to now is include single .js files and one at a time, and the same goes for the image files.

    • avatar
    • John
    • Wed 21 Mar 2007 10:34 AM

    problem selections if year is 2025 or 1900 or month jumping from Jan to Dec i.e too many clicks

  6. Helen, you need to change a couple of ID tags. Change the ID and the button to something else and you should be all set.

    I have my first field using ID = Cal1 (on the HTML tab of the properties box) and in the javascript code, button : "Cal1". My second field is Cal2 and the 3rd is Cal3. I actually have 6 total calendar fields on one form doing it this way.

  7. Thank you so much for having this nice calendar pop-up available. I am developing a seminar/event registration site and this calendar picker is just what we need. It was easy to install, easy to change the date format, and easy to change the help message. Many thanks!

  8. I have 2 dates on a form; start-date and end-date. How do I code so that if end-date is null, it defaults to start-date +1. I have tried numerous versions of the samples, and so far do not have this worked out. This has to have been done before. If you have this code, would you be so kind to share it. thanks.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Fri 25 Jun 2004

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content