pax_global_header00006660000000000000000000000064126340066630014520gustar00rootroot0000000000000052 comment=6c5251ad7ac7628f3facede9442ecd51e858ca76 vali-date-1.0.0/000077500000000000000000000000001263400666300133645ustar00rootroot00000000000000vali-date-1.0.0/.editorconfig000066400000000000000000000003471263400666300160450ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [{package.json,*.yml}] indent_style = space indent_size = 2 [*.md] trim_trailing_whitespace = false vali-date-1.0.0/.gitattributes000066400000000000000000000000141263400666300162520ustar00rootroot00000000000000* text=auto vali-date-1.0.0/.gitignore000066400000000000000000000000151263400666300153500ustar00rootroot00000000000000node_modules vali-date-1.0.0/.travis.yml000066400000000000000000000000761263400666300155000ustar00rootroot00000000000000language: node_js node_js: - 'stable' - '0.12' - '0.10' vali-date-1.0.0/index.js000066400000000000000000000001241263400666300150260ustar00rootroot00000000000000'use strict'; module.exports = function (str) { return !isNaN(Date.parse(str)); }; vali-date-1.0.0/license000066400000000000000000000021551263400666300147340ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) Sam Verschueren (github.com/SamVerschueren) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. vali-date-1.0.0/package.json000066400000000000000000000011101263400666300156430ustar00rootroot00000000000000{ "name": "vali-date", "version": "1.0.0", "description": "Validate a date", "license": "MIT", "repository": "SamVerschueren/vali-date", "author": { "name": "Sam Verschueren", "email": "sam.verschueren@gmail.com", "url": "github.com/SamVerschueren" }, "engines": { "node": ">=0.10.0" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "date", "validator", "iso8601", "moment", "format", "parse" ], "dependencies": {}, "devDependencies": { "ava": "*", "xo": "*" } } vali-date-1.0.0/readme.md000066400000000000000000000011731263400666300151450ustar00rootroot00000000000000# vali-date [![Build Status](https://travis-ci.org/SamVerschueren/vali-date.svg?branch=master)](https://travis-ci.org/SamVerschueren/vali-date) > Validate a date. ## Install ``` $ npm install --save vali-date ``` ## Usage ```js const validate = require('vali-date'); validate('foo'); //=> false validate('2015-12-15T12:00:00Z'); //=> true validate('2015-12-15T12:00:00+01:00'); //=> true ``` ## API ### validate(date) Returns a boolean indicating if the date provided is valid or not. #### date Type: `string` The date that should be validated. ## License MIT © [Sam Verschueren](http://github.com/SamVerschueren) vali-date-1.0.0/test.js000066400000000000000000000003251263400666300147010ustar00rootroot00000000000000import test from 'ava'; import fn from './'; test('validate', t => { t.false(fn('foo')); t.true(fn('2015-12-15T12:00:00Z')); t.true(fn('2015-12-15T12:00:00+01:00')); t.true(fn(new Date().toISOString())); });