2.0.2 ⢠Published 4 years ago
time-counting v2.0.2
time-counting
š¦ ģ¤ėė”ė¶ķ° ķ“ė¹ ė ģ§ź° ė©°ģ¹ ģ ģøģ§, ė©°ģ¹ ķģøģ§ ģ ģ ģėė” ķ“주ė ķØķ¤ģ§ģ
ėė¤.
ģ¤ģ¹
npm ķ¹ģ yarn ģ¼ė” ģ¤ģ¹ ķ ģ ģģµėė¤.
npm
$ npm install time-counting --save$ yarn add time-countingģ¬ģ© ė°©ė²
Javascript
// es5
const TimeCounting = require("time-counting");
const time = TimeCounting("2020-08-10");
const timecount = TimeCounting("2020-08-10 08:00:00", {
objectTime: "2020-08-10 10:00:00"
});
//es6
import TimeCounting from "time-counting";
console.log(TimeCounting("2020-08-10"));
console.log(
TimeCounting("2020-08-10 08:00:00", {
objectTime: "2020-08-10 10:00:00",
lang: "ko"
})
);ģ¤ėģ źø°ģ¤ģ¼ė” 2020ė
8ģ 10ģ¼ģ“ ė©°ģ¹ ģ /ķ ģøģ§ ź²°ź³¼ė” ėķė©ėė¤.
ė ė²ģ§ø ź²°ź³¼ė 2020ė
8ģ 10ģ¼ 10ģ넼 źø°ģ¤ģ¼ė” 2020ė
8ģ 10ģ¼ 8ģģ ģź°ģ ķģøķ©ėė¤.
2ģź° ģ TypeScript
import TimeCounting from "time-counting";
console.log(TimeCounting("2020-08-10", { objectTime: "2020-08-11", lang: "ko" }));1ģ¼ ģ ģµģ
| Name | Value | default | description |
|---|---|---|---|
| objectTime | Date, string, number | new Date() | źø°ģ¤ģ“ ėė ģź°ģ ėė¤. |
| lang | "ko", "en" | "en" | ģøģ“ |
| calculate | Calculate | Calculate | ķ“ė¹ ź°ź¹ģ§ ģ“/ė¶/ģź°/ģ¼ ... ģ ģ¶ė „ķ©ėė¤. |
Calculate
| Name | Value | default | Unit |
|---|---|---|---|
| justNow | number | 20 | second |
| second | number | 60 | second |
| minute | number | 60 | minute |
| hour | number | 24 | hour |
| day | number | 7 | day |
| week | number | 4 | week |
| month | number | 12 | month |
ģģ
const option = {
objectTime: "2020-08-10 06:00:00",
lang: "ko",
calculate: {
justNow: 3601
}
};
console.log(TimeCounting("2020-08-10 05:00:00", option));ė°©źø ģ š¬ 1ģź° 1ģ“ź¹ģ§ė "ė°©źø ģ " ģ¼ė” ķģė©ėė¤.
Testing
npm run test