Commit e55eb3a4218ceb061a12507e168fdd8813ae206c

Authored by Neil Blakey-Milner
1 parent 7587a11a

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 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 520 var p_WinCal = ggWinCal;
521 521 gCal = new Calendar(p_item, p_WinCal, p_month, p_year, p_format);
  522 + gCal.gAfterToday = p_afterToday
522 523  
523 524 // Customize your Calendar here..
524 525 gCal.gBGColor="white";
... ... @@ -552,18 +553,22 @@ function show_calendar() {
552 553 p_format = "MM/DD/YYYY";
553 554 else
554 555 p_format = arguments[3];
  556 + if (arguments[4] == null)
  557 + p_afterToday = true;
  558 + else
  559 + p_afterToday = arguments[4];
555 560  
556 561 vWinCal = window.open("", "Calendar",
557 562 "width=250,height=250,status=no,resizable=no,top=200,left=200");
558 563 vWinCal.opener = self;
559 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 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 572 // Load the defaults..
568 573 if (p_year == null || p_year == "")
569 574 p_year = new String(gNow.getFullYear().toString());
... ... @@ -574,5 +579,5 @@ function show_yearly_calendar(p_item, p_year, p_format) {
574 579 vWinCal.opener = self;
575 580 ggWinCal = vWinCal;
576 581  
577   - Build(p_item, null, p_year, p_format);
578   -}
579 582 \ No newline at end of file
  583 + Build(p_item, null, p_year, p_format, p_afterToday);
  584 +}
... ...