Datepicker problem

Datepicker problem

I have been using Datepicker as supplied with Coffee Cup Software's Web Form Builder and to date I have successfully amended the code as shown below i.e. minDate: 1 maxDate: 60. (That's quite simple and I can cope with that) but exactly how would I amend the code to exclude weekends? I believe it's to do with code lines 93,94 & 95 - showDay but I can't seem to get a result!

Many Thanks

  1. /*
  2.  * jQuery UI Datepicker @VERSION
  3.  *
  4.  * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
  5.  * Dual licensed under the MIT (MIT-LICENSE.txt)
  6.  * and GPL (GPL-LICENSE.txt) licenses.
  7.  *
  8.  * http://docs.jquery.com/UI/Datepicker
  9.  *
  10.  * Depends:
  11.  * jquery.ui.core.js
  12.  */

  13. (function($) { // hide the namespace

  14. $.extend($.ui, { datepicker: { version: "@VERSION" } });

  15. var PROP_NAME = 'datepicker';
  16. var dpuuid = new Date().getTime();

  17. /* Date picker manager.
  18.    Use the singleton instance of this class, $.datepicker, to interact with the date picker.
  19.    Settings for (groups of) date pickers are maintained in an instance object,
  20.    allowing multiple different settings on the same page. */

  21. function Datepicker() {
  22. this.debug = false; // Change this to true to start debugging
  23. this._curInst = null; // The current instance in use
  24. this._keyEvent = false; // If the last event was a key event
  25. this._disabledInputs = []; // List of date picker inputs that have been disabled
  26. this._datepickerShowing = false; // True if the popup picker is showing , false if not
  27. this._inDialog = false; // True if showing within a "dialog", false if not
  28. this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division
  29. this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class
  30. this._appendClass = 'ui-datepicker-append'; // The name of the append marker class
  31. this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class
  32. this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class
  33. this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class
  34. this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class
  35. this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class
  36. this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class
  37. this.regional = []; // Available regional settings, indexed by language code
  38. this.regional[''] = { // Default regional settings
  39. closeText: 'Done', // Display text for close link
  40. prevText: 'Prev', // Display text for previous month link
  41. nextText: 'Next', // Display text for next month link
  42. currentText: 'Today', // Display text for current month link
  43. monthNames: ['January','February','March','April','May','June',
  44. 'July','August','September','October','November','December'], // Names of months for drop-down and formatting
  45. monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting
  46. dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Friday'], // For formatting
  47. dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting
  48. dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday
  49. weekHeader: 'Wk', // Column header for week of the year
  50. dateFormat: 'mm/dd/yy', // See format options on parseDate
  51. firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
  52. isRTL: false, // True if right-to-left language, false if left-to-right
  53. showMonthAfterYear: false, // True if the year select precedes month, false for month then year
  54. yearSuffix: '' // Additional text to append to the year in the month headers
  55. };
  56. this._defaults = { // Global defaults for all the date picker instances
  57. showOn: 'focus', // 'focus' for popup on focus,
  58. // 'button' for trigger button, or 'both' for either
  59. showAnim: 'show', // Name of jQuery animation for popup
  60. showOptions: {}, // Options for enhanced animations
  61. defaultDate: null, // Used when field is blank: actual date,
  62. // +/-number for offset from today, null for today
  63. appendText: '', // Display text following the input box, e.g. showing the format
  64. buttonText: '...', // Text for trigger button
  65. buttonImage: '', // URL for trigger button image
  66. buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
  67. hideIfNoPrevNext: false, // True to hide next/previous month links
  68. // if not applicable, false to just disable them
  69. navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
  70. gotoCurrent: false, // True if today link goes back to current selection instead
  71. changeMonth: false, // True if month can be selected directly, false if only prev/next
  72. changeYear: false, // True if year can be selected directly, false if only prev/next
  73. yearRange: 'c-10:c+10', // Range of years to display in drop-down,
  74. // either relative to today's year (-nn:+nn), relative to currently displayed year
  75. // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
  76. showOtherMonths: false, // True to show dates in other months, false to leave blank
  77. selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
  78. showWeek: false, // True to show week of the year, false to not show it
  79. calculateWeek: this.iso8601Week, // How to calculate the week of the year,
  80. // takes a Date and returns the number of the week for it
  81. shortYearCutoff: '+10', // Short year values < this are in the current century,
  82. // > this are in the previous century,
  83. // string value starting with '+' for current year + value
  84. minDate: 1, // The earliest selectable date, or null for no limit
  85. maxDate: 60, // The latest selectable date, or null for no limit
  86. duration: '_default', // Duration of display/closure
  87. beforeShowDay: null, // Function that takes a date and returns an array with
  88. // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',
  89. // [2] = cell title (optional), e.g. $.datepicker.noWeekends
  90. beforeShow: null, // Function that takes an input field and
  91. // returns a set of custom settings for the date picker
  92. onSelect: null, // Define a callback function when a date is selected
  93. onChangeMonthYear: null, // Define a callback function when the month or year is changed
  94. onClose: null, // Define a callback function when the datepicker is closed
  95. numberOfMonths: 1, // Number of months to show at a time
  96. showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
  97. stepMonths: 1, // Number of months to step back/forward
  98. stepBigMonths: 12, // Number of months to step back/forward for the big links
  99. altField: '', // Selector for an alternate field to store selected dates into
  100. altFormat: '', // The date format to use for the alternate field
  101. constrainInput: true, // The input is constrained by the current date format
  102. showButtonPanel: false, // True to show button panel, false to not show it
  103. autoSize: false // True to size the input for the date format, false to leave as is