Commit c5796736e119c65b8ffa2771715a65baef673a96

Authored by nbm
1 parent 76bbd115

Make it easy to get a calendar that allows you to choose dates in the

past.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3141 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/js/datePicker.js
@@ -516,9 +516,10 @@ Calendar.prototype.format_data = function(p_day) { @@ -516,9 +516,10 @@ Calendar.prototype.format_data = function(p_day) {
516 return vData; 516 return vData;
517 } 517 }
518 518
519 -function Build(p_item, p_month, p_year, p_format) { 519 +function Build(p_item, p_month, p_year, p_format, p_afterToday) {
520 var p_WinCal = ggWinCal; 520 var p_WinCal = ggWinCal;
521 gCal = new Calendar(p_item, p_WinCal, p_month, p_year, p_format); 521 gCal = new Calendar(p_item, p_WinCal, p_month, p_year, p_format);
  522 + gCal.gAfterToday = p_afterToday
522 523
523 // Customize your Calendar here.. 524 // Customize your Calendar here..
524 gCal.gBGColor="white"; 525 gCal.gBGColor="white";
@@ -552,18 +553,22 @@ function show_calendar() { @@ -552,18 +553,22 @@ function show_calendar() {
552 p_format = "MM/DD/YYYY"; 553 p_format = "MM/DD/YYYY";
553 else 554 else
554 p_format = arguments[3]; 555 p_format = arguments[3];
  556 + if (arguments[4] == null)
  557 + p_afterToday = true;
  558 + else
  559 + p_afterToday = arguments[4];
555 560
556 vWinCal = window.open("", "Calendar", 561 vWinCal = window.open("", "Calendar",
557 "width=250,height=250,status=no,resizable=no,top=200,left=200"); 562 "width=250,height=250,status=no,resizable=no,top=200,left=200");
558 vWinCal.opener = self; 563 vWinCal.opener = self;
559 ggWinCal = vWinCal; 564 ggWinCal = vWinCal;
560 565
561 - Build(p_item, p_month, p_year, p_format); 566 + Build(p_item, p_month, p_year, p_format, p_afterToday);
562 } 567 }
563 /* 568 /*
564 Yearly Calendar Code Starts here 569 Yearly Calendar Code Starts here
565 */ 570 */
566 -function show_yearly_calendar(p_item, p_year, p_format) { 571 +function show_yearly_calendar(p_item, p_year, p_format, p_afterToday) {
567 // Load the defaults.. 572 // Load the defaults..
568 if (p_year == null || p_year == "") 573 if (p_year == null || p_year == "")
569 p_year = new String(gNow.getFullYear().toString()); 574 p_year = new String(gNow.getFullYear().toString());
@@ -574,5 +579,5 @@ function show_yearly_calendar(p_item, p_year, p_format) { @@ -574,5 +579,5 @@ function show_yearly_calendar(p_item, p_year, p_format) {
574 vWinCal.opener = self; 579 vWinCal.opener = self;
575 ggWinCal = vWinCal; 580 ggWinCal = vWinCal;
576 581
577 - Build(p_item, null, p_year, p_format);  
578 -}  
579 \ No newline at end of file 582 \ No newline at end of file
  583 + Build(p_item, null, p_year, p_format, p_afterToday);
  584 +}