mirror of
https://github.com/koalyptus/TableFilter.git
synced 2024-06-09 17:32:31 +02:00
Initial commit
This commit is contained in:
parent
1910d93b9f
commit
4e8d4ec9da
42
.eslintrc
Normal file
42
.eslintrc
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
{
|
||||||
|
"parser": "babel-eslint",
|
||||||
|
"rules": {
|
||||||
|
"max-len": [2, 80, 2, {"ignoreUrls": true}],
|
||||||
|
"max-depth": [2, 7],
|
||||||
|
"no-underscore-dangle": 0,
|
||||||
|
"no-loop-func": 2,
|
||||||
|
"curly": 2,
|
||||||
|
"quotes": [2, "single"],
|
||||||
|
//"indent": [2, 4],
|
||||||
|
"no-trailing-spaces": 2,
|
||||||
|
"no-multi-spaces": 2,
|
||||||
|
"array-bracket-spacing": 2,
|
||||||
|
"new-cap": 2
|
||||||
|
//"camelcase": [2, {"properties": "always"}]
|
||||||
|
|
||||||
|
|
||||||
|
/*"-W024": true,
|
||||||
|
"scripturl": true,
|
||||||
|
"evil": true,
|
||||||
|
"curly": true,
|
||||||
|
"indent": 4,
|
||||||
|
"es3": true,
|
||||||
|
"esnext": true,
|
||||||
|
"unused": true,
|
||||||
|
"maxlen" : 80,
|
||||||
|
"trailing": true,
|
||||||
|
"quotmark": "single",
|
||||||
|
"immed": true,
|
||||||
|
"maxstatements": 172,
|
||||||
|
"maxdepth": 7,
|
||||||
|
"maxcomplexity": 87,*/
|
||||||
|
},
|
||||||
|
"ecmaFeatures": {
|
||||||
|
"modules": true
|
||||||
|
},
|
||||||
|
"env": {
|
||||||
|
"es6": true,
|
||||||
|
"browser": true,
|
||||||
|
"node": false
|
||||||
|
}
|
||||||
|
}
|
17
.jshintrc
17
.jshintrc
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
"-W024": true,
|
|
||||||
"scripturl": true,
|
|
||||||
"evil": true,
|
|
||||||
"curly": true,
|
|
||||||
"indent": 4,
|
|
||||||
"es3": true,
|
|
||||||
"esnext": true,
|
|
||||||
"unused": true,
|
|
||||||
"maxlen" : 80,
|
|
||||||
"trailing": true,
|
|
||||||
"quotmark": "single",
|
|
||||||
"immed": true,
|
|
||||||
"maxstatements": 172,
|
|
||||||
"maxdepth": 7,
|
|
||||||
"maxcomplexity": 87
|
|
||||||
}
|
|
20
Gruntfile.js
20
Gruntfile.js
|
@ -11,15 +11,15 @@ module.exports = function (grunt) {
|
||||||
|
|
||||||
grunt.initConfig({
|
grunt.initConfig({
|
||||||
|
|
||||||
jshint: {
|
eslint: {
|
||||||
src: [
|
options: {
|
||||||
|
configFile: '.eslintrc'
|
||||||
|
},
|
||||||
|
target: [
|
||||||
'Gruntfile.js',
|
'Gruntfile.js',
|
||||||
'webpack.config.js',
|
'webpack.config.js',
|
||||||
'src/**/*.js'
|
'src/**/*.js'
|
||||||
],
|
]
|
||||||
options: {
|
|
||||||
jshintrc: '.jshintrc'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
qunit: {
|
qunit: {
|
||||||
|
@ -282,7 +282,7 @@ module.exports = function (grunt) {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
grunt.loadNpmTasks('grunt-eslint');
|
||||||
grunt.loadNpmTasks('grunt-contrib-qunit');
|
grunt.loadNpmTasks('grunt-contrib-qunit');
|
||||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||||
|
@ -302,11 +302,11 @@ module.exports = function (grunt) {
|
||||||
|
|
||||||
// Dev dev/build/watch cycle
|
// Dev dev/build/watch cycle
|
||||||
grunt.registerTask('dev',
|
grunt.registerTask('dev',
|
||||||
['jshint', 'webpack:dev', 'copy:dist', 'stylus:compile', 'watch:app']);
|
['eslint', 'webpack:dev', 'copy:dist', 'stylus:compile', 'watch:app']);
|
||||||
|
|
||||||
// Production build
|
// Production build
|
||||||
grunt.registerTask('build',
|
grunt.registerTask('build',
|
||||||
['jshint', 'webpack:build', 'copy:dist', 'stylus:compile']);
|
['eslint', 'webpack:build', 'copy:dist', 'stylus:compile']);
|
||||||
|
|
||||||
// Build demos
|
// Build demos
|
||||||
grunt.registerTask('dev-demos', ['build-demos', 'watch:templates']);
|
grunt.registerTask('dev-demos', ['build-demos', 'watch:templates']);
|
||||||
|
@ -317,7 +317,7 @@ module.exports = function (grunt) {
|
||||||
grunt.registerTask('dev-modules', ['babel', 'copy:dist']);
|
grunt.registerTask('dev-modules', ['babel', 'copy:dist']);
|
||||||
|
|
||||||
// Tests
|
// Tests
|
||||||
grunt.registerTask('test', ['jshint', 'connect', 'qunit:all']);
|
grunt.registerTask('test', ['eslint', 'connect', 'qunit:all']);
|
||||||
|
|
||||||
// Publish to gh-pages
|
// Publish to gh-pages
|
||||||
grunt.registerTask('publish', 'Publish from CLI', [
|
grunt.registerTask('publish', 'Publish from CLI', [
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "tablefilter",
|
"name": "tablefilter",
|
||||||
"version": "0.1.14",
|
"version": "0.1.15",
|
||||||
"description": "A Javascript library making HTML tables filterable and a bit more",
|
"description": "A Javascript library making HTML tables filterable and a bit more",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": {
|
"author": {
|
||||||
|
@ -29,19 +29,21 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-core": "^6.1.2",
|
"babel-core": "^6.1.2",
|
||||||
|
"babel-eslint": "4.1.8",
|
||||||
"babel-loader": "^6.0.1",
|
"babel-loader": "^6.0.1",
|
||||||
"babel-preset-es2015": "^6.3.13",
|
"babel-preset-es2015": "^6.3.13",
|
||||||
"clean-webpack-plugin": "^0.1.3",
|
"clean-webpack-plugin": "^0.1.3",
|
||||||
|
"eslint": "2.1.0",
|
||||||
"grunt": "^0.4.5",
|
"grunt": "^0.4.5",
|
||||||
"grunt-babel": "^6.0.0",
|
"grunt-babel": "^6.0.0",
|
||||||
"grunt-contrib-clean": "^0.6.0",
|
"grunt-contrib-clean": "^0.6.0",
|
||||||
"grunt-contrib-connect": "^0.10.1",
|
"grunt-contrib-connect": "^0.10.1",
|
||||||
"grunt-contrib-copy": "^0.8.0",
|
"grunt-contrib-copy": "^0.8.0",
|
||||||
"grunt-contrib-jshint": "^0.11.2",
|
|
||||||
"grunt-contrib-qunit": "^0.7.0",
|
"grunt-contrib-qunit": "^0.7.0",
|
||||||
"grunt-contrib-stylus": "^0.22.0",
|
"grunt-contrib-stylus": "^0.22.0",
|
||||||
"grunt-contrib-watch": "^0.6.1",
|
"grunt-contrib-watch": "^0.6.1",
|
||||||
"grunt-esdoc": "^0.0.1",
|
"grunt-esdoc": "^0.0.1",
|
||||||
|
"grunt-eslint": "18.0.0",
|
||||||
"grunt-gh-pages": "^0.10.0",
|
"grunt-gh-pages": "^0.10.0",
|
||||||
"grunt-string-replace": "^1.2.0",
|
"grunt-string-replace": "^1.2.0",
|
||||||
"grunt-webpack": "^1.0.8",
|
"grunt-webpack": "^1.0.8",
|
||||||
|
|
16
src/date.js
16
src/date.js
|
@ -95,30 +95,30 @@ export default {
|
||||||
oDate = new Date(y2kDate(parts[2]),mmm2mm(parts[1])-1,parts[0]);
|
oDate = new Date(y2kDate(parts[2]),mmm2mm(parts[1])-1,parts[0]);
|
||||||
break;
|
break;
|
||||||
case 'DMY':
|
case 'DMY':
|
||||||
/* jshint ignore:start */
|
/* eslint-disable */
|
||||||
parts = dateStr.replace(
|
parts = dateStr.replace(
|
||||||
/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,'$1 $3 $5').split(' ');
|
/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,'$1 $3 $5').split(' ');
|
||||||
oDate = new Date(y2kDate(parts[2]),parts[1]-1,parts[0]);
|
oDate = new Date(y2kDate(parts[2]),parts[1]-1,parts[0]);
|
||||||
/* jshint ignore:end */
|
/* eslint-enable */
|
||||||
break;
|
break;
|
||||||
case 'MDY':
|
case 'MDY':
|
||||||
/* jshint ignore:start */
|
/* eslint-disable */
|
||||||
parts = dateStr.replace(
|
parts = dateStr.replace(
|
||||||
/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/,'$1 $3 $5').split(' ');
|
/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/,'$1 $3 $5').split(' ');
|
||||||
oDate = new Date(y2kDate(parts[2]),parts[0]-1,parts[1]);
|
oDate = new Date(y2kDate(parts[2]),parts[0]-1,parts[1]);
|
||||||
/* jshint ignore:end */
|
/* eslint-enable */
|
||||||
break;
|
break;
|
||||||
case 'YMD':
|
case 'YMD':
|
||||||
/* jshint ignore:start */
|
/* eslint-disable */
|
||||||
parts = dateStr.replace(/^((\d\d)?\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/,'$1 $4 $6').split(' ');
|
parts = dateStr.replace(/^((\d\d)?\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/,'$1 $4 $6').split(' ');
|
||||||
oDate = new Date(y2kDate(parts[0]),parts[1]-1,parts[2]);
|
oDate = new Date(y2kDate(parts[0]),parts[1]-1,parts[2]);
|
||||||
/* jshint ignore:end */
|
/* eslint-enable */
|
||||||
break;
|
break;
|
||||||
default: //in case format is not correct
|
default: //in case format is not correct
|
||||||
/* jshint ignore:start */
|
/* eslint-disable */
|
||||||
parts = dateStr.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,'$1 $3 $5').split(' ');
|
parts = dateStr.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,'$1 $3 $5').split(' ');
|
||||||
oDate = new Date(y2kDate(parts[2]),parts[1]-1,parts[0]);
|
oDate = new Date(y2kDate(parts[2]),parts[1]-1,parts[0]);
|
||||||
/* jshint ignore:end */
|
/* eslint-enable */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return oDate;
|
return oDate;
|
||||||
|
|
Loading…
Reference in a new issue