date-utils-2020
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "date-utils-2020", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "date utils 2020, format(date: Date, formatter: string)/toDate(a?: any)...", | ||
"main": "src/index.js", | ||
"main": "dist/date-utils-2020.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "node test/index.js", | ||
"dev": "webpack serve", | ||
"build": "webpack --mode production" | ||
}, | ||
"types": "types/index.d.ts", | ||
"repository": { | ||
@@ -18,3 +21,3 @@ "type": "git", | ||
"toDate", | ||
"format" | ||
"formatDate" | ||
], | ||
@@ -26,3 +29,21 @@ "author": "Capricorncd", | ||
}, | ||
"homepage": "https://github.com/capricorncd/date-utils-2020#readme" | ||
"homepage": "https://github.com/capricorncd/date-utils-2020#readme", | ||
"devDependencies": { | ||
"@babel/core": "^7.12.9", | ||
"@babel/preset-env": "^7.12.7", | ||
"babel-loader": "^8.2.2", | ||
"clean-webpack-plugin": "^3.0.0", | ||
"eslint": "^7.14.0", | ||
"eslint-config-standard": "^16.0.2", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-standard": "^5.0.0", | ||
"eslint-webpack-plugin": "^2.4.1", | ||
"html-webpack-plugin": "^4.5.0", | ||
"webpack": "^5.9.0", | ||
"webpack-cli": "^4.2.0", | ||
"webpack-dev-server": "^3.11.0", | ||
"webpack-merge": "^5.4.0" | ||
} | ||
} |
@@ -35,3 +35,3 @@ # date-utils-2020 | ||
|:--|:--|:--| | ||
|formatDate|(date: any, fmt: string, languagePack?: object)|return `string`| | ||
|formatDate|(date: any, fmt: string, langPackage?: langPackage)|return `string`| | ||
|toDate|(s: any)|return `Date` or `null`| | ||
@@ -42,2 +42,15 @@ |isNumberLike|(n: any)| return Boolean `true` or `false`| | ||
#### langPackage | ||
|Props|Type|Description| | ||
|:--|:--|:--| | ||
|weeks|`string[]`|Example: `['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']`, Default: `['日', '一', '二', '三', '四', '五', '六']`| | ||
```javascript | ||
const langPackage = { | ||
weeks: ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'] | ||
} | ||
formatDate(new Date(), 'yyyy/MM/dd(W) hh:mm:ss', langPackage) | ||
// 2020/12/05(土曜日) 12:22:52 | ||
``` |
@@ -17,3 +17,3 @@ /** | ||
* @param langPackage | ||
* @returns {number|*} | ||
* @returns {string} | ||
*/ | ||
@@ -20,0 +20,0 @@ function formatDate(srcDate, fmt, langPackage) { |
@@ -28,3 +28,3 @@ /** | ||
* @param n | ||
* @returns {*} | ||
* @returns {string} | ||
*/ | ||
@@ -31,0 +31,0 @@ export function toTwoDigits(n) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
13334
14
268
1
55
16
1
80