+ A lot of distribution Work
This commit is contained in:
parent
afe37e1f78
commit
6ce817ab1b
|
@ -1,5 +1,5 @@
|
||||||
node_modules
|
node_modules
|
||||||
package-lock.json
|
lib
|
||||||
|
|
||||||
dist/*
|
dist/*
|
||||||
!dist/.keep
|
!dist/.keep
|
|
@ -0,0 +1,2 @@
|
||||||
|
src
|
||||||
|
tsconfig.json
|
42
README.md
42
README.md
|
@ -1 +1,43 @@
|
||||||
# Tyme.js
|
# Tyme.js
|
||||||
|
|
||||||
|
[Site](https://justkato.me/) |
|
||||||
|
[Docs/Wiki](https://github.com/JustKato/Tyme.js/wiki) |
|
||||||
|
[Contributing](CONTRIBUTING.md) |
|
||||||
|
|
||||||
|
Building the project yourself:
|
||||||
|
```shell
|
||||||
|
$ git pull https://github.com/JustKato/Tyme.js tymejs
|
||||||
|
$ cd tymejs
|
||||||
|
$ npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
## Download
|
||||||
|
* [Core build](https://github.com/JustKato/Tyme.js/releases/download/3.0.0/tyme.js-3.0.0.zip.zip)
|
||||||
|
|
||||||
|
Tyme.js is released under the [MIT license](license) & supports modern environments.<br>
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
In a browser:
|
||||||
|
```html
|
||||||
|
<script src="tyme.js"></script>
|
||||||
|
```
|
||||||
|
|
||||||
|
Using npm:
|
||||||
|
```shell
|
||||||
|
$ npm i tymejs
|
||||||
|
```
|
||||||
|
In Node.js:
|
||||||
|
```js
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
## Why TymeJS?
|
||||||
|
|
||||||
|
TymeJS makes working with JavaScript date objects much easier, I've found myself<br>
|
||||||
|
multiple times in the situation where the client doesn't like their region's date format
|
||||||
|
and requests for custom formats, this consumed a lot of time implementing, so that's why
|
||||||
|
I have created this library, for:
|
||||||
|
* Reliable Date formats
|
||||||
|
* Reliable Time formats
|
||||||
|
* TypeScript Support
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"transform": {
|
||||||
|
"^.+\\.(t|j)sx?$": "ts-jest"
|
||||||
|
},
|
||||||
|
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
|
||||||
|
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"]
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
16
package.json
16
package.json
|
@ -4,8 +4,9 @@
|
||||||
"description": "Quickly and easily format JavaScript date Objects",
|
"description": "Quickly and easily format JavaScript date Objects",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "esbuild src/index.ts --bundle --minify --sourcemap --target=chrome58,firefox57,safari11,edge16 --outfile=dist/tyme.js",
|
"build": "tsc",
|
||||||
"test": "ts-node ./src/tests/fullTest.ts"
|
"buildweb": "esbuild src/index.ts --bundle --minify --sourcemap --target=chrome58,firefox57,safari11,edge16 --outfile=dist/tyme.js",
|
||||||
|
"test": "jest --config jestconfig.json"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"time",
|
"time",
|
||||||
|
@ -20,5 +21,14 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ts-node": "^10.7.0"
|
"ts-node": "^10.7.0"
|
||||||
}
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/jest": "^27.5.0",
|
||||||
|
"jest": "^28.1.0",
|
||||||
|
"ts-jest": "^28.0.1",
|
||||||
|
"typescript": "^4.6.4"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"lib/**/*"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
import TymeJS from "../index";
|
||||||
|
|
||||||
|
test(`Formatting Test`, () => {
|
||||||
|
let ts = new Date();
|
||||||
|
|
||||||
|
ts.setFullYear(1998);
|
||||||
|
ts.setMonth(9);
|
||||||
|
ts.setDate(24);
|
||||||
|
|
||||||
|
let ty = new TymeJS(ts);
|
||||||
|
|
||||||
|
expect(ty.format("d/m/Y")).toBe("24/10/1998")
|
||||||
|
|
||||||
|
})
|
|
@ -1,4 +1,4 @@
|
||||||
import TymeJS from "..";
|
import TymeJS from "../index";
|
||||||
|
|
||||||
const a = new TymeJS();
|
const a = new TymeJS();
|
||||||
|
|
||||||
|
|
|
@ -42,12 +42,12 @@
|
||||||
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
|
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
|
||||||
|
|
||||||
/* Emit */
|
/* Emit */
|
||||||
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
||||||
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
||||||
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
||||||
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
||||||
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
|
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
|
||||||
"outDir": "./dist/", /* Specify an output folder for all emitted files. */
|
"outDir": "./lib", /* Specify an output folder for all emitted files. */
|
||||||
// "removeComments": true, /* Disable emitting comments. */
|
// "removeComments": true, /* Disable emitting comments. */
|
||||||
// "noEmit": true, /* Disable emitting files from a compilation. */
|
// "noEmit": true, /* Disable emitting files from a compilation. */
|
||||||
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
||||||
|
@ -97,5 +97,7 @@
|
||||||
/* Completeness */
|
/* Completeness */
|
||||||
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
||||||
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||||
}
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["node_modules", "**/__tests__/*"]
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue