Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cron.md #16

Open
wants to merge 2 commits into
base: 0.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions cron.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,42 @@ This will output the following HTML:
```

As you can see, we display the human readable value and show the cron expression when you hover over it.

## Localization

By default, the cron component will translate your expression to English. Use the `locale` attribute to select another destination language:

```html
<x-cron schedule="@weekly" locale="lv" human />
```

This will output the following HTML:

```html
<span title="@weekly">
Katru svētdienu plkst. 12:00am
</span>
```

Currently, the following locales are supported:

- `fr`
- `lv`

Consider contributing to https://github.com/lorisleiva/cron-translator to add more.

## 24-Hour Time Format

To display time in the 24-hour format, the cron component acccepts a `use24hour` boolean attribute:

```html
<x-cron schedule="@weekly" locale="fr" use24hour human />
```

This will output the following HTML:

```html
<span title="@weekly">
Chaque dimanche à 0:00
</span>
```