# cron-conversion-expression

> cron表达式转换

Latest version **1.0.3** (published 2024-08-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install cron-conversion-expression
pnpm add cron-conversion-expression
yarn add cron-conversion-expression
bun add cron-conversion-expression
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2024-08-26 |
| First published | 2023-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 231.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | waiwaiTaDady |
| Maintainers | gu_tai |
| Keywords | cron |

## Links

- npm: https://www.npmjs.com/package/cron-conversion-expression
- npm.io page: https://npm.io/package/cron-conversion-expression

## Dependencies (6)

- [antd](https://npm.io/package/antd.md) ^5.1.5
- [dayjs](https://npm.io/package/dayjs.md) ^1.11.7
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [moment](https://npm.io/package/moment.md) ^2.29.4
- [cronstrue](https://npm.io/package/cronstrue.md) ^2.27.0
- [@ant-design/icons](https://npm.io/package/@ant-design/icons.md) ^5.0.0

## Recent versions

- 1.0.3 (latest) — 2024-08-26
- 1.0.2 — 2023-06-12
- 1.0.1 — 2023-06-12
- 1.0.0 — 2023-06-08

## README

cron表达式转换
#### 使用示例
```js
import translation from 'xxxx.json'
import Cron from 'cron-conversion-expression'
import 'cron-conversion-expression/lib/index.min.css'


const [state, setState] = useState({});

<Cron
  onChange={(e, text) => {
    setState({ value: e });
    console.log(e, text);
  }} // change回调函数
  value={state.value} // 组件的值
  showResultText={true} // 是否展示转化的文本
  showResultCron={true} // 是否展示Cron表达式
  translateFn={(key) => translation[key]} // 国际化配置文件
/>
```

```json
// translation.json
{
    "Every": "每",
    "day(s)": "天",
    "Every week day": "每个工作日",
    "Start time": "开始时间",
    "hour": "小时",
    "At": "在",
    "minute(s)": "分钟",
    "Day": "号",
    "of every month(s)": "每月",
    "Last day of every month": "每月的最后一天",
    "On the last weekday of every month": "每个月的最后一天",
    "before the end of the month": "每月最后",
    "Monday": "星期一",
    "Tuesday": "星期二",
    "Wednesday": "星期三",
    "Thursday": "星期四",
    "Friday": "星期五",
    "Saturday": "星期六",
    "Sunday": "星期日",
    "Minutes": "分钟",
    "Hourly": "小时",
    "Daily": "天",
    "Weekly": "周",
    "Monthly": "月",
    "Custom": "自定义",
    "Expression": "表达式"
}
```


#### ui
![](https://gitee.com/azure-s/cron-conversion-expression/raw/master/imgs/cron-expression-conversion.png)



#### base: https://github.com/sojinantony01/react-cron-generator/

---
_Source: https://npm.io/package/cron-conversion-expression · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
