Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:iamkun/dayjs into lowercaseLocalised…
Browse files Browse the repository at this point in the history
…FormatsFallback

# Conflicts:
#	test/plugin/localizedFormat.test.js
  • Loading branch information
mariomc committed Apr 26, 2019
2 parents d4f79bb + 9279718 commit 247bede
Show file tree
Hide file tree
Showing 163 changed files with 2,349 additions and 366 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ This project exists thanks to all the people who contribute.
Please give us a 💖 star 💖 to support us. Thank you.

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#backers" target="_blank"><img src="https://opencollective.com/dayjs/contributors.svg?width=890" /></a>

## License
Expand Down
8 changes: 7 additions & 1 deletion docs/en/API-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Returns a `string` with the `Dayjs`'s formatted date.
To escape characters, wrap them in square brackets (e.g. `[A] [MM]`).

```js
dayjs().format() // current date in ISO6801, without fraction seconds e.g. '2020-04-02T08:02:17-05:00'
dayjs().format() // current date in ISO8601, without fraction seconds e.g. '2020-04-02T08:02:17-05:00'

dayjs('2019-01-25').format('[YYYY] YYYY-MM-DDTHH:mm:ssZ[Z]') // 'YYYY 2019-01-25T00:00:00-02:00Z'

Expand Down Expand Up @@ -455,6 +455,12 @@ plugin [`IsLeapYear`](./Plugin.md#isleapyear)

plugin [`WeekOfYear`](./Plugin.md#weekofyear)

### WeekDay

`.weekday` to get or set locale aware day of the week

plugin [`WeekDay`](./Plugin.md#weekday)

### IsoWeeksInYear

`.isoWeeksInYear` to get the number of weeks in year
Expand Down
4 changes: 4 additions & 0 deletions docs/en/I18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ const localeObject = {
MM: '%d months',
y: 'a year',
yy: '%d years'
},
meridiem: (hour, minute, isLowercase) => {
// OPTIONAL, AM/PM
return hour > 12 ? 'PM' : 'AM'
}
}
```
Expand Down
13 changes: 13 additions & 0 deletions docs/en/Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,19 @@ dayjs('2018-06-27').week() // 26
dayjs('2018-06-27').week(5) // set week
```

### WeekDay

- WeekDay adds `.weekday()` API to get or set locale aware day of the week.

```javascript
import weekDay from 'dayjs/plugin/weekDay'

dayjs.extend(weekDay)
// when Monday is the first day of the week
dayjs().weekday(-7) // last Monday
dayjs().weekday(7) // next Monday
```

### IsoWeeksInYear

- IsoWeeksInYear adds `.isoWeeksInYear()` API to return a `number` to get the number of weeks in year, according to ISO weeks.
Expand Down
8 changes: 7 additions & 1 deletion docs/es-es/API-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Devuelve un dato de tipo `string` con la fecha del objeto `Dayjs` formateada.
Para escapar caracteres, estos se han de encerrar entre corchetes (p.ej.: `[A] [MM]`).

```js
dayjs().format() // fecha actual en ISO6801, sin fracciones de segundo p.ej. '2020-04-02T08:02:17-05:00'
dayjs().format() // fecha actual en ISO8601, sin fracciones de segundo p.ej. '2020-04-02T08:02:17-05:00'

dayjs('2019-01-25').format('[YYYY] YYYY-MM-DDTHH:mm:ssZ[Z]') // 'YYYY 2019-01-25T00:00:00-02:00Z'

Expand Down Expand Up @@ -455,6 +455,12 @@ complemento [`IsLeapYear`](./Plugin.md#isleapyear)

complemento [`WeekOfYear`](./Plugin.md#weekofyear)

### WeekDay

`.weekday` to get or set locale aware day of the week

plugin [`WeekDay`](./Plugin.md#weekday)

### IsoWeeksInYear

`.isoWeeksInYear` to get the number of weeks in year
Expand Down
4 changes: 4 additions & 0 deletions docs/es-es/I18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ const localeObject = {
MM: '%d months',
y: 'a year',
yy: '%d years'
},
meridiem: (hour, minute, isLowercase) => {
// OPTIONAL, AM/PM
return hour > 12 ? 'PM' : 'AM'
}
}
```
Expand Down
13 changes: 13 additions & 0 deletions docs/es-es/Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,19 @@ dayjs('2018-06-27').week() // 26
dayjs('2018-06-27').week(5) // set week
```

### WeekDay

- WeekDay adds `.weekday()` API to get or set locale aware day of the week.

```javascript
import weekDay from 'dayjs/plugin/weekDay'

dayjs.extend(weekDay)
// when Monday is the first day of the week
dayjs().weekday(-7) // last Monday
dayjs().weekday(7) // next Monday
```

### IsoWeeksInYear

- IsoWeeksInYear adds `.isoWeeksInYear()` API to return a `number` to get the number of weeks in year, according to ISO weeks.
Expand Down
Loading

0 comments on commit 247bede

Please sign in to comment.