/[health_html]/js/DateSelector.js
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /js/DateSelector.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by ravilov, Tue Sep 25 15:38:04 2001 UTC revision 1.4 by ravilov, Tue Oct 30 16:11:28 2001 UTC
# Line 4  function DateSelector(form, date, before Line 4  function DateSelector(form, date, before
4          this.sYear = form.year || form.elements[2] || null;          this.sYear = form.year || form.elements[2] || null;
5          this.yBefore = before || 0;          this.yBefore = before || 0;
6          this.yAfter = after || 0;          this.yAfter = after || 0;
7          this.BaseDate = date || new Date();          this.BaseDate = date || null;
8            if (!this.BaseDate) {
9                    this.BaseDate = new Date();
10                    this.BaseDate = new Date(this.BaseDate.getYear(),
11                            this.BaseDate.getMonth() + 1, this.BaseDate.getDate());
12            } else {
13                    this.BaseDate = new Date(this.BaseDate.getYear(),
14                            this.BaseDate.getMonth() - 1, this.BaseDate.getDate());
15            }
16          this.Rebuild = function(d, m, y) {          this.Rebuild = function(d, m, y) {
17                  var i, sel;                  var i, sel;
18                  // build day selector                  // build day selector
# Line 20  function DateSelector(form, date, before Line 28  function DateSelector(form, date, before
28                  }                  }
29                  // build month selector                  // build month selector
30                  if (this.sMonth != null) {                  if (this.sMonth != null) {
31                          sel = m || this.sMonth.selectedIndex;                          sel = (m - 1) || this.sMonth.selectedIndex;
32                          if (sel < 0) sel = this.BaseDate.getMonth();                          if (sel < 0) sel = this.BaseDate.getMonth();
33                          for (i = 0; i < this.sMonth.options.length; i++)                          for (i = 0; i < this.sMonth.options.length; i++)
34                                  this.sMonth.options[i] = null;                                  this.sMonth.options[i] = null;
# Line 68  function DateSelector(form, date, before Line 76  function DateSelector(form, date, before
76          this.Today = function() {          this.Today = function() {
77                  var t = new Date();                  var t = new Date();
78                  var d = t.getDate() - 1;                  var d = t.getDate() - 1;
79                  var m = t.getMonth();                  var m = t.getMonth() + 1;
80                  var y = this.yBefore;                  var y = this.yBefore;
81                  this.Check(d, m, y);                  this.Check(d, m, y);
82                    this.Check(d, m, y);
83                  this.Rebuild(d, m, y);                  this.Rebuild(d, m, y);
84          }          }
85          this.nDays = null;          this.nDays = null;
86          this.Reset();          this.Reset();
         this.Rebuild();  
87          return this;          return this;
88  }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.26