Skip to content
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>
```