Skip to content

Commit 9587217

Browse files
authored
docs(readme): Clarify date format default value and Locale usage (DenverCoder1#427)
1 parent 9b0767e commit 9587217

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ If the `theme` parameter is specified, any color customizations specified will b
5959
| `currStreakLabel` | Current streak label | **hex code** without `#` or **css color** |
6060
| `sideLabels` | Total and longest streak labels | **hex code** without `#` or **css color** |
6161
| `dates` | Date range text color | **hex code** without `#` or **css color** |
62-
| `date_format` | Date format (Default: `M j[, Y]`) | See note below on [📅 Date Formats](#-date-formats) |
63-
| `locale` | Locale to use for labels (Default: `en`) | ISO 639-1 code - See [🗪 Locales](#-locales) |
62+
| `date_format` | Date format pattern or empty for locale format | See note below on [📅 Date Formats](#-date-formats) |
63+
| `locale` | Locale for labels and numbers (Default: `en`) | ISO 639-1 code - See [🗪 Locales](#-locales) |
6464
| `type` | Output format (Default: `svg`) | Current options: `svg`, `png` or `json` |
6565
| `mode` | Streak mode (Default: `daily`) | `daily` (contribute daily) or `weekly` (contribute once per Sun-Sat week) |
6666

@@ -83,6 +83,8 @@ To enable a theme, append `&theme=` followed by the theme name to the end of the
8383

8484
### 🗪 Locales
8585

86+
The following are the locales that have labels translated in Streak Stats. The `locale` query parameter accepts any ISO language or locale code, see [here](https://gist.github.com/DenverCoder1/f61147ba26bfcf7c3bf605af7d3382d5) for a list of valid locales. The locale provided will be used for the date format and number format even if translations are not yet available.
87+
8688
<!-- This section is automatically generated by the `translation-progress.php` script. -->
8789
<!-- prettier-ignore-start -->
8890
<!-- TRANSLATION_PROGRESS_START -->
@@ -94,6 +96,8 @@ To enable a theme, append `&theme=` followed by the theme name to the end of the
9496

9597
### 📅 Date Formats
9698

99+
If `date_format` is not provided or is empty, the PHP Intl library is used to determine the date format based on the locale specified in the `locale` query parameter.
100+
97101
A custom date format can be specified by passing a string to the `date_format` parameter.
98102

99103
The required format is to use format string characters from [PHP's date function](https://www.php.net/manual/en/datetime.format.php) with brackets around the part representing the year.

0 commit comments

Comments
 (0)