~ubuntu-branches/ubuntu/raring/maas/raring-updates

« back to all changes in this revision

Viewing changes to src/maasserver/static/jslibs/yui/3.4.1/build/datatype-date-parse/datatype-date-parse.js

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-07-03 17:42:37 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20120703174237-p8l0keuuznfg721k
Tags: 0.1+bzr709+dfsg-0ubuntu1
* New Upstream release
* debian/control:
  - Depends on python-celery, python-tempita, libjs-yui3-{full,min},
    libjs-raphael
* debian/maas.install:
  - Install apiclient, celeryconfig.py, maas-import-pxe-files, preseeds_v2.
  - Update to install various files from chroot, rather tha manually copy
    them from the source.
* debian/maas.links: symlink celeryconfig.py
* debian/maas.maas-celery.upstart: Add job.
* debian/rules:
  - Install celery upstart job.
  - Do not install jslibs as packages are now used.
  - Drop copying of maas_local_settings_sample.py as source now ships
    a maas_local_settings.py
* debian/patches:
  - 04-maas-http-fix.patch: Drop. Merged upstream.
  - 01-fix-database-settings.patch: Refreshed.
  - 99_enums_js.patch: Added until creation of enum.js / build process
    is fixed.
* debian/maas.postinst: Update bzr version to correctly handle upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
YUI 3.4.1 (build 4118)
3
 
Copyright 2011 Yahoo! Inc. All rights reserved.
4
 
Licensed under the BSD License.
5
 
http://yuilibrary.com/license/
6
 
*/
7
 
YUI.add('datatype-date-parse', function(Y) {
8
 
 
9
 
/**
10
 
 * Parse number submodule.
11
 
 *
12
 
 * @module datatype
13
 
 * @submodule datatype-date-parse
14
 
 * @for DataType.Date
15
 
 */
16
 
var LANG = Y.Lang;
17
 
 
18
 
Y.mix(Y.namespace("DataType.Date"), {
19
 
    /**
20
 
     * Converts data to type Date.
21
 
     *
22
 
     * @method parse
23
 
     * @param data {String | Number} Data to convert. Values supported by the Date constructor are supported.
24
 
     * @return {Date} A Date, or null.
25
 
     */
26
 
    parse: function(data) {
27
 
        var date = null;
28
 
 
29
 
        //Convert to date
30
 
        if(!(LANG.isDate(data))) {
31
 
            date = new Date(data);
32
 
        }
33
 
        else {
34
 
            return date;
35
 
        }
36
 
 
37
 
        // Validate
38
 
        if(LANG.isDate(date) && (date != "Invalid Date") && !isNaN(date)) { // Workaround for bug 2527965
39
 
            return date;
40
 
        }
41
 
        else {
42
 
            return null;
43
 
        }
44
 
    }
45
 
});
46
 
 
47
 
// Add Parsers shortcut
48
 
Y.namespace("Parsers").date = Y.DataType.Date.parse;
49
 
 
50
 
 
51
 
}, '3.4.1' );