Nodeschool Public Materials

    @jsmicro/is-date

    1.0.2 • Public • Published

    JSMicro - Is Date

    isDate(object)

    Check does the given Javascript Object (array, object, string, etc) is a date.

    isNotDate(object)

    Check does the given Javascript Date (array, object, string, etc) is not a date.

    Browser Usage

    bower install --save jsmicro-is-date
    <script type="text/javascript" src="bower_components/jsmicro-is-date/index.js">
    <script type="text/javascript">
        var obj = new Date();
        var nbr = 200;
    
        // Available in the window object.
        isDate(obj);      // true
        isDate(nbr);      // false
        isNotDate(nbr);   // true
    </script>

    NodeJS Usage

    npm install --save @jsmicro/is-date
    const obj = require('@jsmicro/is-date');
    
    // Available in the global object.
    isDate(new Date()); // true
    isDate(23322333); // false
    isNotDate(23234); // true
    
    // Also available in the export object.
    obj.isDate(new Date()); // true
    obj.isDate(23322333); // false
    obj.isNotDate(23333); // true

    Changelogs

    v1.0.1 - May 21, 2016

    • Added .npmignore

    v1.0.0 - May 19, 2016

    • Initial release.

    The MIT License (MIT)

    Install

    npm i @jsmicro/is-date

    DownloadsWeekly Downloads

    2

    Version

    1.0.2

    License

    MIT

    Last publish

    Collaborators

    • mahdaen