~ubuntu-branches/ubuntu/natty/ntop/natty

« back to all changes in this revision

Viewing changes to html/MochiKit/DateTime.js

  • Committer: Bazaar Package Importer
  • Author(s): Ludovico Cavedon, Jordan Metzmeier, Ludovico Cavedon
  • Date: 2010-12-15 20:06:19 UTC
  • mfrom: (5.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20101215200619-0ojz3iak95ihibun
Tags: 3:4.0.3+dfsg1-1
[ Jordan Metzmeier ]
* New upstream release (Closes: #522042)
* Move data files to /usr/share/ntop (Closes: #595450).
* Package architecture independent data in a separate ntop-data package.
* Use debhelper 7.
* Update Standards-Version to 3.9.1.
* Depend on python-mako.
* Do not include ntop.txt in binary packages as it is a copy of the man
  page.
* Do not include NEWS, as it is outdated.
* Switch to package source version 3.0 (quilt).
* Add password creation to debconf
* Changed init script to fix localization problems (thanks to Alejandro
  Varas <alej0varas@gmail.com>, LP: #257466)
* Remove manual update-rc.d calls from postrm and postinst. debhelper adds
  this for us.
* Add pre-depends on adduser for postinst script.
* Fix errors in the manpages: fix-manpage-errors.patch.
* Added fixes for matching active interfaces.
* Added a watch file.

[ Ludovico Cavedon ]
* Remove direct changes to upstream tree, and move them into specific patch
  files:
  - fix-manpage-errors.patch: fix typos in ntop.8.
  - dot-path.patch: fix path of /usr/bin/dot executable
* Add patches:
  - reduce-autogen-purged-files.patch: prevent agutogen.sh from reamoving
  too many files during cleanup.
  - Add build-without-ntop-darwin.patch, to fix compilation without
  ntop_darwin.c.
* No longer add faq.html, as it is not distributed in the upstream tarball.
* Use ${source:Version} in control file. Have ntop-data recommend
  ntop.
* Rename dirs to ntop.dirs and keep only empty directories that need
  to be created.
* Remove var/lib from ntop.install file, as it is empty (keeping it in
  ntop.dirs).
* Update po files.
* Breaks and Replaces instead of Conflitcs for ntop-data.
* Use a longer package description.
* Remove useless configure options from debian/rules.
* Move private shared libraries libraries in /usr/lib/ntop.
* Add change-plugin-dir.patch for adjusting plugin directory.
* Remove development files.
* Use system library for MochiKit.js.
* Rewrite DEP5 copyright file.
* Repackage upstream tarball in order to remove non-DFSG-compliant code. Add
  get-orig-source.sh script and get-orig-source target in debian/rules.
* Add explanation to README.Debian why geolocation is no longer working.
* Add avoid-copy-maxmind-db.patch to prevent copying of Geo*.dat
  files.
* Remove old unused patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***
2
2
 
3
 
MochiKit.DateTime 1.3.1
 
3
MochiKit.DateTime 1.4.2
4
4
 
5
5
See <http://mochikit.com/> for documentation, downloads, license, etc.
6
6
 
8
8
 
9
9
***/
10
10
 
11
 
if (typeof(dojo) != 'undefined') {
12
 
    dojo.provide('MochiKit.DateTime');
13
 
}
14
 
 
15
 
if (typeof(MochiKit) == 'undefined') {
16
 
    MochiKit = {};
17
 
}
18
 
       
19
 
if (typeof(MochiKit.DateTime) == 'undefined') {
20
 
    MochiKit.DateTime = {};
21
 
}
 
11
MochiKit.Base._deps('DateTime', ['Base']);
22
12
 
23
13
MochiKit.DateTime.NAME = "MochiKit.DateTime";
24
 
MochiKit.DateTime.VERSION = "1.3.1";
 
14
MochiKit.DateTime.VERSION = "1.4.2";
25
15
MochiKit.DateTime.__repr__ = function () {
26
16
    return "[" + this.NAME + " " + this.VERSION + "]";
27
17
};
29
19
    return this.__repr__();
30
20
};
31
21
 
 
22
/** @id MochiKit.DateTime.isoDate */
32
23
MochiKit.DateTime.isoDate = function (str) {
33
24
    str = str + "";
34
25
    if (typeof(str) != "string" || str.length === 0) {
38
29
    if (iso.length === 0) {
39
30
        return null;
40
31
    }
41
 
    return new Date(iso[0], iso[1] - 1, iso[2]);
 
32
        var date = new Date(iso[0], iso[1] - 1, iso[2]);
 
33
        date.setFullYear(iso[0]);
 
34
        date.setMonth(iso[1] - 1);
 
35
        date.setDate(iso[2]);
 
36
    return date;
42
37
};
43
38
 
44
39
MochiKit.DateTime._isoRegexp = /(\d{4,})(?:-(\d{1,2})(?:-(\d{1,2})(?:[T ](\d{1,2}):(\d{1,2})(?::(\d{1,2})(?:\.(\d+))?)?(?:(Z)|([+-])(\d{1,2})(?::(\d{1,2}))?)?)?)?)?/;
45
40
 
 
41
/** @id MochiKit.DateTime.isoTimestamp */
46
42
MochiKit.DateTime.isoTimestamp = function (str) {
47
43
    str = str + "";
48
44
    if (typeof(str) != "string" || str.length === 0) {
88
84
    return new Date(Date.UTC(year, month, day, hour, min, sec, msec) - ofs);
89
85
};
90
86
 
 
87
/** @id MochiKit.DateTime.toISOTime */
91
88
MochiKit.DateTime.toISOTime = function (date, realISO/* = false */) {
92
89
    if (typeof(date) == "undefined" || date === null) {
93
90
        return null;
103
100
    return lst.join(":");
104
101
};
105
102
 
 
103
/** @id MochiKit.DateTime.toISOTimeStamp */
106
104
MochiKit.DateTime.toISOTimestamp = function (date, realISO/* = false*/) {
107
105
    if (typeof(date) == "undefined" || date === null) {
108
106
        return null;
115
113
    return MochiKit.DateTime.toISODate(date) + sep + MochiKit.DateTime.toISOTime(date, realISO) + foot;
116
114
};
117
115
 
 
116
/** @id MochiKit.DateTime.toISODate */
118
117
MochiKit.DateTime.toISODate = function (date) {
119
118
    if (typeof(date) == "undefined" || date === null) {
120
119
        return null;
121
120
    }
122
121
    var _padTwo = MochiKit.DateTime._padTwo;
 
122
        var _padFour = MochiKit.DateTime._padFour;
123
123
    return [
124
 
        date.getFullYear(),
 
124
        _padFour(date.getFullYear()),
125
125
        _padTwo(date.getMonth() + 1),
126
126
        _padTwo(date.getDate())
127
127
    ].join("-");
128
128
};
129
129
 
 
130
/** @id MochiKit.DateTime.americanDate */
130
131
MochiKit.DateTime.americanDate = function (d) {
131
132
    d = d + "";
132
133
    if (typeof(d) != "string" || d.length === 0) {
140
141
    return (n > 9) ? n : "0" + n;
141
142
};
142
143
 
 
144
MochiKit.DateTime._padFour = function(n) {
 
145
        switch(n.toString().length) {
 
146
                case 1: return "000" + n; break;
 
147
                case 2: return "00" + n; break;
 
148
                case 3: return "0" + n; break;
 
149
                case 4:
 
150
                default:
 
151
                        return n;
 
152
        }
 
153
};
 
154
 
 
155
/** @id MochiKit.DateTime.toPaddedAmericanDate */
143
156
MochiKit.DateTime.toPaddedAmericanDate = function (d) {
144
157
    if (typeof(d) == "undefined" || d === null) {
145
158
        return null;
152
165
    ].join('/');
153
166
};
154
167
 
 
168
/** @id MochiKit.DateTime.toAmericanDate */
155
169
MochiKit.DateTime.toAmericanDate = function (d) {
156
170
    if (typeof(d) == "undefined" || d === null) {
157
171
        return null;
187
201
            } catch (e) {
188
202
                // pass
189
203
            }
190
 
        }   
 
204
        }
191
205
    }
192
206
};
193
207
 
198
212
} else {
199
213
    (function (globals, module) {
200
214
        if ((typeof(JSAN) == 'undefined' && typeof(dojo) == 'undefined')
201
 
            || (typeof(MochiKit.__compat__) == 'boolean' && MochiKit.__compat__)) {
 
215
            || (MochiKit.__export__ === false)) {
202
216
            var all = module.EXPORT_TAGS[":all"];
203
217
            for (var i = 0; i < all.length; i++) {
204
 
                globals[all[i]] = module[all[i]]; 
 
218
                globals[all[i]] = module[all[i]];
205
219
            }
206
 
        }   
207
 
    })(this, MochiKit.DateTime);  
 
220
        }
 
221
    })(this, MochiKit.DateTime);
208
222
}