formatjs

JavaScript date format tester.

formatjs

JavaScript date format tester.

Install the module with: npm install formatjs

var formatjs = require('./formatjs');
formatjs.test('12/04', 'YYYY/MM');   // false 
formatjs.test('2012/04', 'YYYY/MM'); // true 

Download the production version or the development version.

In your web page:

<script src="dist/formatjs.min.js"></script>
<script>
formatjs.test('12/04', 'YYYY/MM');   // false
formatjs.test('2012/04', 'YYYY/MM'); // true
</script> 

In your web page using AMD loader:

<script>
require(['formatjs'], function(formatjs) {
    formatjs.test('12/04', 'YYYY/MM');   // false
    formatjs.test('2012/04', 'YYYY/MM'); // true
});
</script> 

Install nodejs.
Install coffee-script with: npm install -g coffee-script.
Install dependencies with: npm install.

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Test your code using grunt.

Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "src" subdirectory!

Copyright (c) 2012 nowamasa
Licensed under the MIT license.