public
Description: Fleegix.js provides an extremely lightweight, cross-browser set of JavaScript tools for building dynamic Web-app UIs.
Homepage: http://js.fleegix.org
Clone URL: git://github.com/mde/fleegix-js-javascript-toolkit.git
commit  c3f3468fc6b198035bce0632458bf15bfc9cc3cb
tree    00859ada505979fb6cabc55f6f553c59f09b1866
parent  f7c2afcdd3d62944d3c7b60501135cb429d298ee
100644 37 lines (35 sloc) 1.164 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
fleegixMain.test_fleegixDateUtil = new function () {
  this.test_diffWeekday = function () {
      var interv = fleegix.date.util.dateParts.WEEKDAY;
      var diff = function () {
        return fleegix.date.util.diff(dtA, dtB, interv);
      }
      var add = fleegix.date.util.add;
      var dtA = null;
      var dtB = null;
      dtA = new Date(2000, 0, 1);
      dtB = add(dtA, interv, 1);
      jum.assertEquals(1, diff());
      dtA = new Date(2000, 0, 2);
      dtB = add(dtA, interv, 1);
      jum.assertEquals(1, diff());
      dtA = new Date(2000, 0, 2);
      dtB = add(dtA, interv, 5);
      jum.assertEquals(5, diff());
      dtA = new Date(2000, 0, 2);
      dtB = add(dtA, interv, 6);
      jum.assertEquals(6, diff());
      dtA = new Date(2000, 0, 3);
      dtB = add(dtA, interv, 10);
      jum.assertEquals(10, diff());
      dtA = new Date(2000, 0, 8);
      dtB = add(dtA, interv, -5);
      jum.assertEquals(-5, diff());
      dtA = new Date(2000, 0, 9);
      dtB = add(dtA, interv, -3);
      jum.assertEquals(-3, diff());
      dtA = new Date(2000, 0, 23);
      dtB = add(dtA, interv, -11);
      jum.assertEquals(-11, diff());
  };
};