Contact Information

Chris Toohey

    Publishings
    Remove my name from the Domino Directory!! 02/05/2008
    Lotus Notes
    Quick and Dirty Mail Application Document Importing 01/24/2008
    Methods and Strategies
    Addressing Domino Web-based @DBLookup limitations with Rich-Text and Context Profiles 12/16/2007
    Domino Web Development
    Dynarch Calendar - Date Blockers 01/25/2007
    Integrated Solutions
    Domino Flex Fields 11/03/2006
    Methods and Strategies
    Site Resources

    RSS Site Content
    Syndicate This Site!
    DG Banner Logo
    Advertisements

    IBM Lotus Notes and Domino 7 now available

    Dynarch Calendar - Date Blockers

    01/25/2007 03:56:59 PM | Mike Smelser | Atlanta, GA

    A client of mine has a "Time & Attendance" database that I was updating the code to be a little more web-savvy. Using the open source DHTML calendar from Dynarch, I was able to give a pretty snazzy looking calendar tool. But the functionality of the time sheets called for the user to select a Sunday as the start date for the timesheet, and if they did not it would alert them to make another selection. Instead of doing this, I decided to only allow the user to select a Sunday from the DHTML calendar itself and, along with the assistance of the DominoGuru himself, came up with the JavaScript function to add to the calendar to achieve this.

    This particular calendar has the functionality built in to run a JavaScript function to basically "turn off" dates you do not want to have available. So I used the code below to turn off all dates except Sundays:

    function dateStatus(date) {
    if (date.getDay() != 0) {
     return true; // true says "disable"
     } else {
     return false; // leave other dates enabled
    }
    }

    ...then in the Calendar.setup code I added this:

    Calendar.setup(
    {
     inputField:"calendar_date",
     ifFormat:"%m/%e/%Y",
     button:"calendar_trigger",
     align:"BR",
     singleClick:"false",
     dateStatusFunc:dateStatus
    }
    )
    and BINGO!

    Dynarch Calendar with Dates Excluded


    Michael Smelser
    Lotus Notes/Domino Application Developer
    Lotus911
    770.517.0092 (phone) | 404.663.1058 (cell) | 678.594.6756 (fax)
    http://www.Lotus911.com

    Lotus911!


    Add a New Comment


    (Not Published/Public)
    Remember my Information!

    (Enter the text from the image to proceed)

    (Full markup allowed in the comment field below; play nice!)

    Live Comments Preview