Skip to content

Commit

Permalink
Release Merge pull request #719 from iamkun/dev
Browse files Browse the repository at this point in the history
D2M
  • Loading branch information
andrewhood125ruhuc committed May 14, 2027
2 parents 5d4b611 + 7081f74 commit 86275cd
Show file tree
Hide file tree
Showing 25 changed files with 260 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
github: [iamkun]
patreon: # Replace with a single Patreon username
open_collective: dayjs
ko_fi: # Replace with a single Ko-fi username
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
<a href="https://opencollective.com/dayjs/sponsor/0/website" target="_blank"><img src="https://opencollective.com/dayjs/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/dayjs/sponsor/1/website" target="_blank"><img src="https://opencollective.com/dayjs/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/dayjs/sponsor/2/website" target="_blank"><img src="https://opencollective.com/dayjs/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/dayjs/sponsor/3/website" target="_blank"><img src="https://opencollective.com/dayjs/sponsor/3/avatar.svg"></a>

## Contributors

Expand All @@ -114,6 +115,7 @@ And thank you to all our backers! 🙏
<a href="https://opencollective.com/dayjs/backer/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/dayjs/backer/0/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/dayjs/backer/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/dayjs/backer/1/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/dayjs/backer/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/dayjs/backer/2/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/dayjs/backer/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/dayjs/backer/3/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/dayjs#backers" target="_blank"><img src="https://opencollective.com/dayjs/contributors.svg?width=890" /></a>

## License
Expand Down
2 changes: 1 addition & 1 deletion docs/en/API-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ dayjs('2019-01-25').format('DD/MM/YYYY') // '25/01/2019'
| `s` | 0-59 | The second |
| `ss` | 00-59 | The second, 2-digits |
| `SSS` | 000-999 | The millisecond, 3-digits |
| `Z` | +5:00 | The offset from UTC |
| `Z` | +05:00 | The offset from UTC |
| `ZZ` | +0500 | The offset from UTC, 2-digits |
| `A` | AM PM | |
| `a` | am pm | |
Expand Down
22 changes: 13 additions & 9 deletions docs/en/Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,18 @@ dayjs().format('Q Do k kk X x')

List of added formats:

| Format | Output | Description |
| ------ | ---------------- | ---------------------------------- |
| `Q` | 1-4 | Quarter |
| `Do` | 1st 2nd ... 31st | Day of Month with ordinal |
| `k` | 1-24 | The hour, beginning at 1 |
| `kk` | 01-24 | The hour, 2-digits, beginning at 1 |
| `X` | 1360013296 | Unix Timestamp in second |
| `x` | 1360013296123 | Unix Timestamp in millisecond |
| Format | Output | Description |
| ------ | --------------------- | ----------------------------------------------------- |
| `Q` | 1-4 | Quarter |
| `Do` | 1st 2nd ... 31st | Day of Month with ordinal |
| `k` | 1-24 | The hour, beginning at 1 |
| `kk` | 01-24 | The hour, 2-digits, beginning at 1 |
| `X` | 1360013296 | Unix Timestamp in second |
| `x` | 1360013296123 | Unix Timestamp in millisecond |
| `w` | 1 2 ... 52 53 | Week of year (depend: weekOfYear plugin) |
| `ww` | 01 02 ... 52 53 | Week of year, 2-digits (depend: weekOfYear plugin) |
| `wo` | 1st 2nd ... 52nd 53rd | Week of year with ordinal (depend: weekOfYear plugin) |
| `gggg` | 2017 | Week Year (depend: weekYear plugin) |

### LocalizedFormat

Expand Down Expand Up @@ -368,7 +372,7 @@ dayjs('2018 Enero 15', 'YYYY MMMM DD', 'es')
| `S` | 0-9 | Hundreds of milliseconds, 1-digit |
| `SS` | 00-99 | Tens of milliseconds, 2-digits |
| `SSS` | 000-999 | Milliseconds, 3-digits |
| `Z` | -5:00 | Offset from UTC |
| `Z` | -05:00 | Offset from UTC |
| `ZZ` | -0500 | Compact offset from UTC, 2-digits |
| `A` | AM PM | Post or ante meridiem, upper-case |
| `a` | am pm | Post or ante meridiem, lower-case |
Expand Down
2 changes: 1 addition & 1 deletion docs/es-es/API-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ dayjs('2019-01-25').format('DD/MM/YYYY') // '25/01/2019'
| `s` | 0-59 | Segundos |
| `ss` | 00-59 | Segundos, con 2 dígitos |
| `SSS` | 000-999 | Milisegundos, con 3 dígitos |
| `Z` | +5:00 | Diferencia horaria UTC |
| `Z` | +05:00 | Diferencia horaria UTC |
| `ZZ` | +0500 | Diferencia horaria UTC, con 2 dígitos |
| `A` | AM PM | |
| `a` | am pm | |
Expand Down
22 changes: 13 additions & 9 deletions docs/es-es/Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,18 @@ dayjs().format('Q Do k kk X x')

Lista de formatos añadidos:

| Formato | Salida | Descripción |
| ------- | ------------- | ------------------------------------- |
| `Q` | 1-4 | Cuarto |
| `Do` | 1º 2º ... 31º | Día del mes con ordinal |
| `k` | 1-24 | Hora, contando desde 1 |
| `kk` | 01-24 | Hora, con 2 dígitos, contando desde 1 |
| `X` | 1360013296 | Tiempo Unix en segundos |
| `x` | 1360013296123 | Tiempo Unix en milisegundos |
| Formato | Salida | Descripción |
| ------- | --------------------- | ----------------------------------------------------- |
| `Q` | 1-4 | Cuarto |
| `Do` | 1º 2º ... 31º | Día del mes con ordinal |
| `k` | 1-24 | Hora, contando desde 1 |
| `kk` | 01-24 | Hora, con 2 dígitos, contando desde 1 |
| `X` | 1360013296 | Tiempo Unix en segundos |
| `x` | 1360013296123 | Tiempo Unix en milisegundos |
| `w` | 1 2 ... 52 53 | Week of year (depend: weekOfYear plugin) |
| `ww` | 01 02 ... 52 53 | Week of year, 2-digits (depend: weekOfYear plugin) |
| `wo` | 1st 2nd ... 52nd 53rd | Week of year with ordinal (depend: weekOfYear plugin) |
| `gggg` | 2017 | Week Year (depend: weekYear plugin) |

### LocalizedFormat

Expand Down Expand Up @@ -364,7 +368,7 @@ dayjs('2018 Enero 15', 'YYYY MMMM DD', 'es')
| `S` | 0-9 | Hundreds of milliseconds, 1-digit |
| `SS` | 00-99 | Tens of milliseconds, 2-digits |
| `SSS` | 000-999 | Milliseconds, 3-digits |
| `Z` | -5:00 | Offset from UTC |
| `Z` | -05:00 | Offset from UTC |
| `ZZ` | -0500 | Compact offset from UTC, 2-digits |
| `A` | AM PM | Post or ante meridiem, upper-case |
| `a` | am pm | Post or ante meridiem, lower-case |
Expand Down
2 changes: 1 addition & 1 deletion docs/ja/API-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ dayjs('2019-01-25').format('DD/MM/YYYY') // '25/01/2019'
| `s` | 0-59 ||
| `ss` | 00-59 | 2 桁の秒 |
| `SSS` | 000-999 | 3 桁のミリ秒 |
| `Z` | +5:00 | UTC からのオフセット |
| `Z` | +05:00 | UTC からのオフセット |
| `ZZ` | +0500 | UTC からの 2 桁のオフセット |
| `A` | AM PM | 午前と午後(大文字) |
| `a` | am pm | 午前と午後(小文字) |
Expand Down
22 changes: 13 additions & 9 deletions docs/ja/Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,18 @@ dayjs().format('Q Do k kk X x')

追加されるフォーマットの一覧:

| フォーマット | 出力 | 説明 |
| ------------ | ---------------- | ---------------------------- |
| `Q` | 1-4 | 四半期 |
| `Do` | 1st 2nd ... 31st | 序数付きの日 |
| `k` | 1-24 | 1 始まりの時間 |
| `kk` | 01-24 | 1 始まりで 2 桁の時間 |
| `X` | 1360013296 | Unix タイムスタンプ (秒) |
| `x` | 1360013296123 | Unix タイムスタンプ (ミリ秒) |
| フォーマット | 出力 | 説明 |
| ------------ | --------------------- | ----------------------------------------------------- |
| `Q` | 1-4 | 四半期 |
| `Do` | 1st 2nd ... 31st | 序数付きの日 |
| `k` | 1-24 | 1 始まりの時間 |
| `kk` | 01-24 | 1 始まりで 2 桁の時間 |
| `X` | 1360013296 | Unix タイムスタンプ (秒) |
| `x` | 1360013296123 | Unix タイムスタンプ (ミリ秒) |
| `w` | 1 2 ... 52 53 | Week of year (depend: weekOfYear plugin) |
| `ww` | 01 02 ... 52 53 | Week of year, 2-digits (depend: weekOfYear plugin) |
| `wo` | 1st 2nd ... 52nd 53rd | Week of year with ordinal (depend: weekOfYear plugin) |
| `gggg` | 2017 | Week Year (depend: weekYear plugin) |

### LocalizedFormat

Expand Down Expand Up @@ -373,7 +377,7 @@ dayjs('2018 5月 15', 'YYYY MMMM DD', 'ja')
| `S` | 0-9 | Hundreds of milliseconds, 1-digit |
| `SS` | 00-99 | Tens of milliseconds, 2-digits |
| `SSS` | 000-999 | Milliseconds, 3-digits |
| `Z` | -5:00 | Offset from UTC |
| `Z` | -05:00 | Offset from UTC |
| `ZZ` | -0500 | Compact offset from UTC, 2-digits |
| `A` | AM PM | Post or ante meridiem, upper-case |
| `a` | am pm | Post or ante meridiem, lower-case |
Expand Down
2 changes: 1 addition & 1 deletion docs/ko/API-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ dayjs('2019-01-25').format('DD/MM/YYYY') // '25/01/2019'
| `s` | 0-59 ||
| `ss` | 00-59 | 초, 두 자리로 표현 |
| `SSS` | 000-999 | 밀리 초, 3자리로 표현 |
| `Z` | +5:00 | UTC로부터 추가된 시간 |
| `Z` | +05:00 | UTC로부터 추가된 시간 |
| `ZZ` | +0500 | UTC로부터 추가된 시간, 두자리로 표현 |
| `A` | AM PM | |
| `a` | am pm | |
Expand Down
22 changes: 13 additions & 9 deletions docs/ko/Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,18 @@ dayjs().format('Q Do k kk X x')

추가된 형식 목록:

| Format | Output | Description |
| ------ | ---------------- | ---------------------------- |
| `Q` | 1-4 | 분기 |
| `Do` | 1st 2nd ... 31st | 서수형식의 일자 명 |
| `k` | 1-24 | 시간, 1부터 시작 |
| `kk` | 01-24 | 시간, 2자리 표현, 1부터 시작 |
| `X` | 1360013296 | 유닉스 타임스템프, 초 |
| `x` | 1360013296123 | 유닉스 타임스탬프, 밀리 초 |
| Format | Output | Description |
| ------ | --------------------- | ----------------------------------------------------- |
| `Q` | 1-4 | 분기 |
| `Do` | 1st 2nd ... 31st | 서수형식의 일자 명 |
| `k` | 1-24 | 시간, 1부터 시작 |
| `kk` | 01-24 | 시간, 2자리 표현, 1부터 시작 |
| `X` | 1360013296 | 유닉스 타임스템프, 초 |
| `x` | 1360013296123 | 유닉스 타임스탬프, 밀리 초 |
| `w` | 1 2 ... 52 53 | Week of year (depend: weekOfYear plugin) |
| `ww` | 01 02 ... 52 53 | Week of year, 2-digits (depend: weekOfYear plugin) |
| `wo` | 1st 2nd ... 52nd 53rd | Week of year with ordinal (depend: weekOfYear plugin) |
| `gggg` | 2017 | Week Year (depend: weekYear plugin) |

### LocalizedFormat

Expand Down Expand Up @@ -365,7 +369,7 @@ dayjs('2018 5월 15', 'YYYY MMMM DD', 'ko')
| `S` | 0-9 | Hundreds of milliseconds, 1-digit |
| `SS` | 00-99 | Tens of milliseconds, 2-digits |
| `SSS` | 000-999 | Milliseconds, 3-digits |
| `Z` | -5:00 | Offset from UTC |
| `Z` | -05:00 | Offset from UTC |
| `ZZ` | -0500 | Compact offset from UTC, 2-digits |
| `A` | AM PM | Post or ante meridiem, upper-case |
| `a` | am pm | Post or ante meridiem, lower-case |
Expand Down
2 changes: 1 addition & 1 deletion docs/pt-br/API-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ dayjs('2019-01-25').format('DD/MM/YYYY') // '25/01/2019'
| `s` | 0-59 | Segundo |
| `ss` | 00-59 | Segundo, com 2 dígitos |
| `SSS` | 000-999 | Milisegundo, com 3 dígitos |
| `Z` | +5:00 | Diferença do fuso horário UTC |
| `Z` | +05:00 | Diferença do fuso horário UTC |
| `ZZ` | +0500 | Diferença do fuso horário UTC, com 2 dígitos |
| `A` | AM PM | |
| `a` | am pm | |
Expand Down
2 changes: 1 addition & 1 deletion docs/pt-br/I18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dayjs.locale('es') // usar a localidade 'es' globalmente
dayjs.locale('de-german', de) // usar a localidade 'de' e alterar a string padrão
const customizedLocaleObject = { ... } // mais detalhes podem ser vistos na sessão de customização abaixo
dayjs.locale(customizedLocaleObject) // usar uma localidade customizada
dayjs.locale('en') // alterna de volta a localidade globalmente para padrão em inglês
dayjs.locale('en') // alterna de volta a localidade globalmente para padrão em inglês
```

- Mudar o _locale_ global não afeta instâncias já existentes.
Expand Down
22 changes: 13 additions & 9 deletions docs/pt-br/Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,18 @@ dayjs().format('Q Do k kk X x')

Lista de formatos adicionados:

| Formato | Saída | Descrição |
| ------- | ---------------- | ------------------------------------ |
| `Q` | 1-4 | Quarter |
| `Do` | 1st 2nd ... 31st | Dia do mês com ordinal |
| `k` | 1-24 | Hora (começando do 1) |
| `kk` | 01-24 | Hora, com 2 dígitos (começando do 1) |
| `X` | 1360013296 | Unix Timestamp em segundos |
| `x` | 1360013296123 | Unix Timestamp em milissegundos |
| Formato | Saída | Descrição |
| ------- | --------------------- | ----------------------------------------------------- |
| `Q` | 1-4 | Quarter |
| `Do` | 1st 2nd ... 31st | Dia do mês com ordinal |
| `k` | 1-24 | Hora (começando do 1) |
| `kk` | 01-24 | Hora, com 2 dígitos (começando do 1) |
| `X` | 1360013296 | Unix Timestamp em segundos |
| `x` | 1360013296123 | Unix Timestamp em milissegundos |
| `w` | 1 2 ... 52 53 | Week of year (depend: weekOfYear plugin) |
| `ww` | 01 02 ... 52 53 | Week of year, 2-digits (depend: weekOfYear plugin) |
| `wo` | 1st 2nd ... 52nd 53rd | Week of year with ordinal (depend: weekOfYear plugin) |
| `gggg` | 2017 | Week Year (depend: weekYear plugin) |

### LocalizedFormat

Expand Down Expand Up @@ -364,7 +368,7 @@ dayjs('2018 Fevereiro 15', 'YYYY MMMM DD', 'pt_br')
| `S` | 0-9 | Hundreds of milliseconds, 1-digit |
| `SS` | 00-99 | Tens of milliseconds, 2-digits |
| `SSS` | 000-999 | Milliseconds, 3-digits |
| `Z` | -5:00 | Offset from UTC |
| `Z` | -05:00 | Offset from UTC |
| `ZZ` | -0500 | Compact offset from UTC, 2-digits |
| `A` | AM PM | Post or ante meridiem, upper-case |
| `a` | am pm | Post or ante meridiem, lower-case |
Expand Down
4 changes: 2 additions & 2 deletions docs/zh-cn/API-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ dayjs().format('{YYYY} MM-DDTHH:mm:ssZ[Z]') // "{2014} 09-08T08:02:17-05:00Z"
| `s` | 0-59 ||
| `ss` | 00-59 | 秒 两位数 |
| `SSS` | 000-999 | 毫秒 三位数 |
| `Z` | +5:00 | UTC 的偏移量 |
| `Z` | +05:00 | UTC 的偏移量 |
| `ZZ` | +0500 | UTC 的偏移量,数字前面加上 0 |
| `A` | AM PM | |
| `a` | am pm | |
Expand All @@ -344,7 +344,7 @@ dayjs().format('{YYYY} MM-DDTHH:mm:ssZ[Z]') // "{2014} 09-08T08:02:17-05:00Z"
```js
const date1 = dayjs('2019-01-25')
const date2 = dayjs('2018-06-05')
date1.diff(date2) // 20214000000
date1.diff(date2) // 20214000000
date1.diff(date2, 'month') // 7
date1.diff(date2, 'month', true) // 7.645161290322581
date1.diff(date2, 'day') // 233
Expand Down
Loading

0 comments on commit 86275cd

Please sign in to comment.