-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
74 additions
and
181 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
node_modules | ||
bower_components | ||
coverage | ||
npm-debug.log | ||
yarn.lock | ||
package-lock.json | ||
.DS_Store | ||
.idea | ||
.vscode | ||
|
||
# vscode localhistory | ||
.history | ||
dist | ||
|
||
# package manager | ||
npm-debug.log | ||
yarn.lock | ||
package-lock.json | ||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
(function() { | ||
'use strict'; | ||
const gulp = require('gulp'); | ||
const { NxScripts, CleanRegistry } = require('@jswork/gulp-registry'); | ||
|
||
const gulp = require('gulp'); | ||
const fs = require('fs'); | ||
const task1 = new CleanRegistry(); | ||
const task2 = new NxScripts({ name: 'qs', classify: false }); | ||
|
||
//import | ||
fs.readdirSync('./build').map(function(file) { | ||
require('./build/' + file); | ||
}); | ||
[task1, task2].forEach(gulp.registry); | ||
|
||
gulp.task('default', gulp.series(['clean', 'scripts'])); | ||
})(); | ||
gulp.task('default', gulp.series(['clean', 'nx:scripts'])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
interface Result { | ||
hour: number; | ||
minute: number; | ||
second: number; | ||
millisecond: number; | ||
datetime: string; | ||
} | ||
|
||
interface NxStatic { | ||
timeFormat: (ts: number) => Result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@jswork/next-time-format", | ||
"version": "1.0.3", | ||
"description": "Time format for next.", | ||
"homepage": "https://github.com/afeiship/next-time-format", | ||
"homepage": "https://js.work", | ||
"author": { | ||
"name": "afei", | ||
"email": "[email protected]" | ||
|
@@ -14,37 +14,34 @@ | |
"release": "release-it" | ||
}, | ||
"main": "dist/index.js", | ||
"module": "dist/index.esm.js", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@jswork/gulp-pkg-header": "^1.0.2", | ||
"@jswork/next": "^1.0.2", | ||
"@babel/core": "^7.21.3", | ||
"@babel/preset-env": "^7.20.2", | ||
"@jswork/gulp-pkg-header": "^1.0.8", | ||
"@jswork/gulp-registry": "^1.0.22", | ||
"@jswork/next": "^1.1.8", | ||
"del": "^6.0.0", | ||
"gulp": "^4.0.2", | ||
"gulp-debug": "^4.0.0", | ||
"gulp-header": "^2.0.9", | ||
"gulp-ignore": "^3.0.0", | ||
"gulp-load-plugins": "^2.0.5", | ||
"gulp-babel": "^8.0.0", | ||
"gulp-prettier": "^4.0.0", | ||
"gulp-rename": "^2.0.0", | ||
"gulp-size": "^3.0.0", | ||
"gulp-replace": "^1.1.4", | ||
"gulp-uglify": "^3.0.2", | ||
"jest": "^26.6.3", | ||
"prettier": "^2.1.2", | ||
"release-it": "^14.2.1", | ||
"uglify-js": "3.11.6", | ||
"jest": "^29.5.0", | ||
"jest-location-mock": "^1.0.9", | ||
"uglify-save-license": "^0.4.1" | ||
}, | ||
"babel": { | ||
"presets": [ | ||
[ | ||
"@babel/preset-env" | ||
] | ||
] | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org" | ||
}, | ||
"keywords": [ | ||
"next", | ||
"time", | ||
"format", | ||
"date", | ||
"left", | ||
"hour", | ||
"minute", | ||
"second" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
(function () { | ||
var global = typeof window !== 'undefined' ? window : this || Function('return this')(); | ||
var nx = global.nx || require('@jswork/next'); | ||
/* prettier-ignore */ | ||
var pad = function (value) { return ('' + value).padStart(2, '0'); }; | ||
import nx from '@jswork/next'; | ||
|
||
nx.timeFormat = function (inTimestamp) { | ||
var millisecond = parseInt(inTimestamp % 1000), | ||
second = Math.floor((inTimestamp / 1000) % 60), | ||
minute = Math.floor((inTimestamp / (1000 * 60)) % 60), | ||
hour = Math.floor(inTimestamp / (1000 * 60 * 60)); | ||
/* prettier-ignore */ | ||
const pad = function (value) { return ('' + value).padStart(2, '0'); }; | ||
|
||
return { | ||
hour: hour, | ||
minute: minute, | ||
second: second, | ||
millisecond: millisecond, | ||
datetime: [pad(hour), pad(minute), pad(second)].join(':') | ||
}; | ||
nx.timeFormat = function (inTimestamp) { | ||
const millisecond = parseInt(inTimestamp % 1000), | ||
second = Math.floor((inTimestamp / 1000) % 60), | ||
minute = Math.floor((inTimestamp / (1000 * 60)) % 60), | ||
hour = Math.floor(inTimestamp / (1000 * 60 * 60)); | ||
|
||
return { | ||
hour: hour, | ||
minute: minute, | ||
second: second, | ||
millisecond: millisecond, | ||
datetime: [pad(hour), pad(minute), pad(second)].join(':') | ||
}; | ||
}; | ||
|
||
if (typeof module !== 'undefined' && module.exports && typeof wx === 'undefined') { | ||
module.exports = nx.timeFormat; | ||
} | ||
|
||
if (typeof module !== 'undefined' && module.exports) { | ||
module.exports = nx.timeFormat; | ||
} | ||
})(); | ||
export default nx.timeFormat; |