-
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
1 parent
f101aad
commit 24bf2cf
Showing
4 changed files
with
53 additions
and
19 deletions.
There are no files selected for viewing
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 +1,3 @@ | ||
theme: jekyll-theme-minimal | ||
theme: jekyll-theme-minimal | ||
title: node-shi | ||
show_downloads: true |
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,19 +1,47 @@ | ||
{ | ||
"name": "node-shi", | ||
"version": "0.2.0", | ||
"description": "It's a lib which let you to transfer human time to computer-readable time and also to transfer computer-generated time to human time, available for English and Chinese.", | ||
"main": "index.js", | ||
"author": { | ||
"name": "Roderick Qiu", | ||
"url": "http://github.com/RoderickQiu" | ||
}, | ||
"license": "MIT", | ||
"scripts": { | ||
"test": "node test.js" | ||
}, | ||
"dependencies": { | ||
"chinese-numbers-converter": "^2.3.1", | ||
"english2number": "^1.0.8", | ||
"js-pinyin": "^0.1.9" | ||
} | ||
}, | ||
"description": "It's a lib which let you to transfer human time to computer-readable time and also to transfer computer-generated time to human time, available for English and Chinese.", | ||
"author": { | ||
"name": "Roderick Qiu", | ||
"email": "scrisqiu@hotmail.com", | ||
"url": "http://github.com/RoderickQiu" | ||
}, | ||
"homepage": "https://shi.r-q.name", | ||
"bugs": { | ||
"url": "https://github.com/RoderickQiu/node-shi/issues", | ||
"email": "scrisqiu@hotmail.com" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/RoderickQiu/node-shi.git" | ||
}, | ||
"license": "MIT", | ||
"keywords": [ | ||
"node-shi", | ||
"shi", | ||
"time", | ||
"duration", | ||
"scris", | ||
"RoderickQiu", | ||
"human", | ||
"semantic", | ||
"computer", | ||
"convert", | ||
"converter", | ||
"Chinese", | ||
"English", | ||
"language", | ||
"timestamp", | ||
"generate" | ||
] | ||
} |
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,7 +1,7 @@ | ||
var shi = require('./index.js'); | ||
|
||
// human time -> time in Arabic number | ||
console.log(shi.humanTimeParser("five hundreds and twenty one seconds")); | ||
console.log(shi.humanTimeParser("1 day 52 min 16sec")); | ||
console.log(shi.humanTimeParser("三十三分钟")); | ||
console.log(shi.humanTimeParser("50", 'min')) | ||
console.log(shi.humanTimeParser("five hundreds and twenty one seconds"));//521 | ||
console.log(shi.humanTimeParser("a day and 一 hour, 52 min 16sec"));//93136 | ||
console.log(shi.humanTimeParser("三十三分钟"));//1980 | ||
console.log(shi.humanTimeParser("50", 'min'))//3000 |