diff --git a/README.md b/README.md
index e2982cc0..5b9bfe21 100644
--- a/README.md
+++ b/README.md
@@ -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! 🙏
+
+
+
+
## License
diff --git a/docs/en/API-reference.md b/docs/en/API-reference.md
index 75788ede..aa8ad550 100644
--- a/docs/en/API-reference.md
+++ b/docs/en/API-reference.md
@@ -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'
@@ -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
diff --git a/docs/en/I18n.md b/docs/en/I18n.md
index 6226e32f..045cb8c1 100644
--- a/docs/en/I18n.md
+++ b/docs/en/I18n.md
@@ -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'
}
}
```
diff --git a/docs/en/Plugin.md b/docs/en/Plugin.md
index c54ec91c..506e6a99 100644
--- a/docs/en/Plugin.md
+++ b/docs/en/Plugin.md
@@ -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.
diff --git a/docs/es-es/API-reference.md b/docs/es-es/API-reference.md
index 3c891370..01e397d7 100644
--- a/docs/es-es/API-reference.md
+++ b/docs/es-es/API-reference.md
@@ -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'
@@ -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
diff --git a/docs/es-es/I18n.md b/docs/es-es/I18n.md
index 30a950d5..551f3878 100644
--- a/docs/es-es/I18n.md
+++ b/docs/es-es/I18n.md
@@ -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'
}
}
```
diff --git a/docs/es-es/Plugin.md b/docs/es-es/Plugin.md
index 1b5362af..fe05f080 100644
--- a/docs/es-es/Plugin.md
+++ b/docs/es-es/Plugin.md
@@ -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.
diff --git a/docs/ja/API-reference.md b/docs/ja/API-reference.md
index c8625773..529e632f 100644
--- a/docs/ja/API-reference.md
+++ b/docs/ja/API-reference.md
@@ -4,326 +4,299 @@ Day.js は組み込みの `Date.prototype` を変更する代わりに `Dayjs`
`Dayjs` オブジェクトは不変 (immutable) です。すなわち、すべての API 操作は新しい `Dayjs` オブジェクトを返します。
-- [Parse](#parse)
- - [Now](#now)
- - [String](#string)
- - [Date](#date)
- - [Unix Timestamp (milliseconds)](#unix-timestamp-milliseconds)
- - [Unix Timestamp (seconds)](#unix-timestamp-seconds)
+- [API Reference](#api-reference)
+- [Parsing](#parsing)
+ - [Constructor `dayjs(dateType?: string | number | Date | Dayjs)`](#constructor-dayjsdatetype-string--number--date--dayjs)
+ - [ISO 8601 形式](#iso-8601-%E5%BD%A2%E5%BC%8F)
+ - [Native Javascript Date object](#native-javascript-date-object)
+ - [Unix Timestamp (milliseconds)](#unix-timestamp-milliseconds)
+ - [Unix Timestamp (seconds) `.unix(value: number)`](#unix-timestamp-seconds-unixvalue-number)
- [Custom Parse Format](#custom-parse-format)
- - [Clone](#clone)
- - [Validation](#validation)
-- [Get + Set](#get--set)
- - [Year](#year)
- - [Month](#month)
- - [Date of Month](#date-of-month)
- - [Day of Week](#day-of-week)
- - [Hour](#hour)
- - [Minute](#minute)
- - [Second](#second)
- - [Millisecond](#millisecond)
- - [Get](#get)
- - [Set](#set)
-- [Manipulate](#manipulate)
- - [Add](#add)
- - [Subtract](#subtract)
- - [Start of Time](#start-of-time)
- - [End of Time](#end-of-time)
-- [Display](#display)
- - [Format](#format)
- - [Difference](#difference)
- - [Unix Timestamp (milliseconds)](#unix-timestamp-milliseconds-1)
- - [Unix Timestamp (seconds)](#unix-timestamp-seconds)
- - [UTC offset (minutes)](#utc-offset-minutes-utcoffset)
- - [Days in Month](#days-in-month)
- - [As Javascript Date](#as-javascript-date)
- - [As JSON](#as-json)
- - [As ISO 8601 String](#as-iso-8601-string)
- - [As String](#as-string)
+ - [Clone `.clone() | dayjs(original: Dayjs)`](#clone-clone--dayjsoriginal-dayjs)
+ - [Validation `.isValid()`](#validation-isvalid)
+- [Get and Set](#get-and-set)
+ - [Year `.year()`](#year-year)
+ - [Month `.month()`](#month-month)
+ - [Day of the Month `.date()`](#day-of-the-month-date)
+ - [Day of the Week `.day()`](#day-of-the-week-day)
+ - [Hour `.hour()`](#hour-hour)
+ - [Minute `.minute()`](#minute-minute)
+ - [Second `.second()`](#second-second)
+ - [Millisecond `.millisecond()`](#millisecond-millisecond)
+ - [Get `.get(unit: string)`](#get-getunit-string)
+ - [List of all available units](#list-of-all-available-units)
+ - [Set `.set(unit: string, value: number)`](#set-setunit-string-value-number)
+- [Manipulating](#manipulating)
+ - [Add `.add(value: number, unit: string)`](#add-addvalue-number-unit-string)
+ - [Subtract `.subtract(value: number, unit: string)`](#subtract-subtractvalue-number-unit-string)
+ - [Start of Time `.startOf(unit: string)`](#start-of-time-startofunit-string)
+ - [End of Time `.endOf(unit: string)`](#end-of-time-endofunit-string)
+- [Displaying](#displaying)
+ - [Format `.format(stringWithTokens: string)`](#format-formatstringwithtokens-string)
+ - [List of all available formats](#list-of-all-available-formats)
+ - [Difference `.diff(compared: Dayjs, unit: string (default: 'milliseconds'), float?: boolean)`](#difference-diffcompared-dayjs-unit-string-default-milliseconds-float-boolean)
+ - [Unix Timestamp (milliseconds) `.valueOf()`](#unix-timestamp-milliseconds-valueof)
+ - [Unix Timestamp (seconds) `.unix()`](#unix-timestamp-seconds-unix)
+ - [UTC Offset (minutes) `.utcOffset()`](#utc-offset-minutes-utcoffset)
+ - [Days in the Month `.daysInMonth()`](#days-in-the-month-daysinmonth)
+ - [As Javascript Date `.toDate()`](#as-javascript-date-todate)
+ - [As JSON `.toJSON()`](#as-json-tojson)
+ - [As ISO 8601 String `.toISOString()`](#as-iso-8601-string-toisostring)
+ - [As String `.toString()`](#as-string-tostring)
- [Query](#query)
- - [Is Before](#is-before)
- - [Is Same](#is-same)
- - [Is After](#is-after)
- - [Is a Dayjs](#is-a-dayjs)
+ - [Is Before `.isBefore(compared: Dayjs, unit?: string)`](#is-before-isbeforecompared-dayjs-unit-string)
+ - [Is Same `.isSame(compared: Dayjs, unit?: string)`](#is-same-issamecompared-dayjs-unit-string)
+ - [Is After `.isAfter(compared: Dayjs, unit?: string)`](#is-after-isaftercompared-dayjs-unit-string)
+ - [Is a Dayjs `.isDayjs(compared: any)`](#is-a-dayjs-isdayjscompared-any)
- [UTC](#utc)
- [Plugin APIs](#plugin-apis)
----
+## Parsing
-Day.js は指定されない限り、常に新しい Dayjs オブジェクトを返します。
+### Constructor `dayjs(dateType?: string | number | Date | Dayjs)`
-### Parse
-
-サポートされている入力形式のいずれかで `dayjs()` を呼び出します。
-
-#### Now
-
-現在の日付と時間を取得するには、パラメータなしで dayjs() を呼び出します。
+パラメータなしで実行すると現在の日付と時刻を持った新しい`Dayjs`オブジェクトを返します。
```js
dayjs()
```
-### String
+Day.js は他の日付フォーマットもパースします。
-[ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) に準拠する形式から作成します。
+#### [ISO 8601](https://ja.wikipedia.org/wiki/ISO_8601) 形式
```js
-dayjs(String)
-dayjs('1995-12-25')
+dayjs('2018-04-04T16:00:00.000Z')
```
-### Date
-
-JavaScript の組み込みの Date オブジェクトを渡します。
+#### Native Javascript Date object
```js
-dayjs(Date)
dayjs(new Date(2018, 8, 18))
```
-### Unix Timestamp (milliseconds)
+#### Unix Timestamp (milliseconds)
-Unix エポック (1970 年 1 月 1 日 12:00AM UTC) 以降のミリ秒数を表す整数値を渡します。
+Unix タイムスタンプ(Unix エポックのミリ秒)から`Dayjs`オブジェクトを返します。
```js
-dayjs(Number)
dayjs(1318781876406)
```
-### Unix Timestamp (seconds)
+### Unix Timestamp (seconds) `.unix(value: number)`
+
+Unix タイムスタンプ(Unix エポックの秒)から`Dayjs`オブジェクトを返します。
```js
-dayjs.unix(Number)
dayjs.unix(1318781876)
+dayjs.unix(1318781876.721)
```
### Custom Parse Format
-- parse custom formats `dayjs("12-25-1995", "MM-DD-YYYY")` in plugin [`CustomParseFormat`](./Plugin.md#customparseformat)
+- `dayjs("12-25-1995", "MM-DD-YYYY")` といった独自フォーマットのパースは[`CustomParseFormat`](./Plugin.md#customparseformat)で利用できます。
-### Clone
+### Clone `.clone() | dayjs(original: Dayjs)`
-すべての `Dayjs` は不変 (immutable) です。 オブジェクトのコピーが必要な場合は、 `.clone()` を呼び出してください。
-`Dayjs` オブジェクトに対して dayjs() を呼び出すと、それもクローンされます。
+`Dayjs`オブジェクトを複製して返します。
```js
-dayjs(Dayjs)
dayjs().clone()
+dayjs(dayjs('2019-01-25')) // Dayjsオブジェクトをコンストラクタに渡しても複製されます
```
-### Validation
-
-- Boolean を返します
+### Validation `.isValid()`
-`Dayjs` オブジェクトが有効な日付かどうかをチェックします。
+`Dayjs`の日付が有効かの真偽値を返します。
```js
dayjs().isValid()
```
----
-
-### Get + Set
-
-日付の取得と設定です。
+## Get and Set
-#### Year
+### Year `.year()`
-Gets or sets the year.
+年の取得と設定。
```js
dayjs().year()
dayjs().year(2000)
```
-#### Month
+### Month `.month()`
-Gets or sets the month. Starts at 0
+月の取得と設定です。月は`0`から始まります。
```js
dayjs().month()
dayjs().month(0)
```
-#### Date of Month
+### Day of the Month `.date()`
-Gets or sets the day of the month. Starts at 1
+月の日にちの取得と設定です。日にちは`1`から始まります。
```js
dayjs().date()
dayjs().date(1)
```
-#### Day of Week
+### Day of the Week `.day()`
-Gets or sets the day of the week. Starts on Sunday with 0
+曜日の取得と設定です。`0`で日曜日から始まります。
```js
dayjs().day()
dayjs().day(0)
```
-#### Hour
+### Hour `.hour()`
-Gets or sets the hour.
+時の取得と設定です。
```js
dayjs().hour()
dayjs().hour(12)
```
-#### Minute
+### Minute `.minute()`
-Gets or sets the minute.
+分の取得と設定です。
```js
dayjs().minute()
dayjs().minute(59)
```
-#### Second
+### Second `.second()`
-Gets or sets the second.
+秒の取得と設定です。
```js
dayjs().second()
dayjs().second(1)
```
-#### Millisecond
+### Millisecond `.millisecond()`
-Gets or sets the millisecond.
+ミリ秒の取得と設定です。
```js
dayjs().millisecond()
dayjs().millisecond(1)
```
-#### Get
+### Get `.get(unit: string)`
-Returns a `number` with information getting from `Dayjs` object
-単位は大文字・小文字を区別しません。
+`Dayjs` オブジェクトから`数値`を返します。
```js
-dayjs().get(unit: String)
-dayjs().get('month') // start 0
+dayjs().get('month') // `0`始まり
dayjs().get('day')
```
#### List of all available units
-| Unit | Shorthand | Description |
-| ------------- | --------- | ---------------------------------------- |
-| `date` | | Date of Month |
-| `day` | `d` | Day of Week (Sunday as 0, Saturday as 6) |
-| `month` | `M` | Month (January as 0, December as 11) |
-| `year` | `y` | Year |
-| `hour` | `h` | Hour |
-| `minute` | `m` | Minute |
-| `second` | `s` | Second |
-| `millisecond` | `ms` | Millisecond |
+| 単位 | ショートハンド | 説明 |
+| ------------- | -------------- | -------------------------------- |
+| `date` | | 月の日ひち |
+| `day` | `d` | 曜日(日曜日は`0`、土曜日は`6`) |
+| `month` | `M` | 月(1 月は`0`、12 月は`11`) |
+| `year` | `y` | 年 |
+| `hour` | `h` | 時 |
+| `minute` | `m` | 分 |
+| `second` | `s` | 秒 |
+| `millisecond` | `ms` | ミリ秒 |
-#### Set
+### Set `.set(unit: string, value: number)`
-日付のセッターです。
+変更を適応した`Dayjs`オブジェクトを返します。
```js
-dayjs().set(unit: String, value: Int)
dayjs().set('date', 1)
dayjs().set('month', 3) // 4月
dayjs().set('second', 30)
```
-### Manipulate
+## Manipulating
-`Dayjs` オブジェクトは次のような方法で操作することができます:
+様々な方法で`Dayjs`オブジェクトを操作できます。
```js
-dayjs()
- .startOf('month')
+dayjs('2019-01-25')
.add(1, 'day')
.subtract(1, 'year')
+ .toString() // Fri, 26 Jan 2018 00:00:00 GMT
```
-#### Add
+### Add `.add(value: number, unit: string)`
-時間を足して新しい `Dayjs` オブジェクトを返します。
+指定した時間を追加した`Dayjs`オブジェクトを複製して返します。
```js
-dayjs().add(value: Number, unit: String)
dayjs().add(7, 'day')
```
-#### Subtract
+### Subtract `.subtract(value: number, unit: string)`
-時間を引いて新しい `Dayjs` オブジェクトを返します。 `dayjs#add` と全く同じです。
+指定した時間を引いた`Dayjs`オブジェクトを複製して返します。
```js
-dayjs().subtract((value: Number), (unit: String))
dayjs().subtract(7, 'year')
```
-#### Start of Time
-
-Returns a new `Dayjs` object by by setting it to the start of a unit of time.
+### Start of Time `.startOf(unit: string)`
-ある単位の始まりの時間の新しい `Dayjs` オブジェクトを返します。
+指定した単位の開始時点に設定された`Dayjs`オブジェクトを複製して返します。
```js
-dayjs().startOf((unit: String))
-dayjs().startOf('week') // Depends on `weekStart` in locale
+dayjs().startOf('week') // locale の `weekStart` に依存
```
-#### End of Time
+### End of Time `.endOf(unit: string)`
-ある単位の終わりの時間の新しい `Dayjs` オブジェクトを返します。
+指定した単位の終了時点に設定された`Dayjs`オブジェクトを複製して返します。
```js
-dayjs().endOf((unit: String))
dayjs().endOf('month')
```
----
-
-### Display
-
-パースや操作が完了したならば `Dayjs` オブジェクトを表示する方法が求められるはずです。
+## Displaying
-#### Format
+### Format `.format(stringWithTokens: string)`
-- String を返します
-
-文字列を受け取り、対応する日付の値で置き換えます。
+フォーマットされた日付の文字列を返します。
+文字をエスケープするにはブラケットで囲みます。(例 `[A][MM]`)
```js
-dayjs().format(String)
-dayjs().format() // "2014-09-08T08:02:17-05:00" (ISO 8601 形式、小数部は含まない)
+dayjs().format() // ISO8601形式で、端数秒なしの現在の日時。例 '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'
-```
-- 文字列内の文字をエスケープするには、文字を角括弧で囲みます (例: [Z]) 。
+dayjs('2019-01-25').format('DD/MM/YYYY') // '25/01/2019'
+```
-使用可能なフォーマットの一覧:
+#### List of all available formats
| フォーマット | 出力 | 説明 |
| ------------ | ---------------- | --------------------------- |
| `YY` | 18 | 2 桁の年 |
| `YYYY` | 2018 | 4 桁の年 |
| `M` | 1-12 | 1 始まりの月 |
-| `MM` | 01-12 | 1 始まりかつ 2 桁の月 |
+| `MM` | 01-12 | 1 始まりの 2 桁の月 |
| `MMM` | Jan-Dec | 月の略称 |
| `MMMM` | January-December | 月の正式名 |
-| `D` | 1-31 | 日 |
-| `DD` | 01-31 | 2 桁の日 |
-| `d` | 0-6 | 曜日 (日曜は 0) |
+| `D` | 1-31 | 月ごとの日にち |
+| `DD` | 01-31 | 月ごとの 2 桁の日にち |
+| `d` | 0-6 | `0`で日曜日から始まる曜日 |
| `dd` | Su-Sa | 最も短い曜日の略称 |
| `ddd` | Sun-Sat | 曜日の略称 |
| `dddd` | Sunday-Saturday | 曜日名 |
| `H` | 0-23 | 時間 |
| `HH` | 00-23 | 2 桁の時間 |
| `h` | 1-12 | 12 時制の時間 |
-| `hh` | 01-12 | 12 時制かつ 2 桁の時間 |
+| `hh` | 01-12 | 12 時制で 2 桁の時間 |
| `m` | 0-59 | 分 |
| `mm` | 00-59 | 2 桁の分 |
| `s` | 0-59 | 秒 |
@@ -331,17 +304,15 @@ dayjs('2019-01-25').format('[YYYY] YYYY-MM-DDTHH:mm:ssZ[Z]') // 'YYYY 2019-01-25
| `SSS` | 000-999 | 3 桁のミリ秒 |
| `Z` | +5:00 | UTC からのオフセット |
| `ZZ` | +0500 | UTC からの 2 桁のオフセット |
-| `A` | AM PM | 午前と午後 (大文字) |
-| `a` | am pm | 午前と午後 (小文字) |
+| `A` | AM PM | 午前と午後(大文字) |
+| `a` | am pm | 午前と午後(小文字) |
-- plugin [`AdvancedFormat`](./Plugin.md#advancedformat) にはより多くのフォーマット(例: `Q Do k kk X x ...` )が存在します。
-- Localized format options `L LT LTS ...` in plugin [`LocalizedFormat`](./Plugin.md#localizedFormat)
+- 利用可能な他のフォーマット `Q Do k kk X x ...` in plugin [`AdvancedFormat`](./Plugin.md#advancedformat)
+- ローカライズのフォーマットオプション `L LT LTS ...` in plugin [`LocalizedFormat`](./Plugin.md#localizedFormat)
-#### Difference
+### Difference `.diff(compared: Dayjs, unit: string (default: 'milliseconds'), float?: boolean)`
-- Number を返します
-
-2 つの `Dayjs` オブジェクトの差をミリ秒単位で取得します。
+2 つの`Dayjs`オブジェクトの差分を指定した単位で数値で返します。
```js
const date1 = dayjs('2019-01-25')
@@ -352,214 +323,194 @@ date1.diff(date2, 'month', true) // 7.645161290322581
date1.diff(date2, 'day') // 233
```
-#### Unix Timestamp (milliseconds)
-
-- Number を返します
+### Unix Timestamp (milliseconds) `.valueOf()`
-Unix エポックからのミリ秒数を出力します。
+`Dayjs`オブジェクトの Unix エポックからのミリ秒を数値で返します。
```js
-dayjs().valueOf()
+dayjs('2019-01-25').valueOf() // 1548381600000
```
-#### Unix Timestamp (seconds)
-
-- Number を返します
+### Unix Timestamp (seconds) `.unix()`
-Unix タイムスタンプ (Unix エポックからの秒数) を出力します。
+`Dayjs`オブジェクトの Unix エポックからの秒を数値で返します。
```js
-dayjs().unix()
+dayjs('2019-01-25').unix() // 1548381600
```
-### UTC Offset (minutes)
+### UTC Offset (minutes) `.utcOffset()`
-Returns the UTC offset in minutes for the `Dayjs`.
+`Dayjs`オブジェクトの UTC オフセットを分単位の数値で返します。
```js
dayjs().utcOffset()
```
-#### Days in Month
+### Days in the Month `.daysInMonth()`
-- Number を返します
-
-その月の日数を取得します。
+`Dayjs`オブジェクトの月の日数を数値で返します。
```js
-dayjs().daysInMonth()
+dayjs('2019-01-25').daysInMonth() // 31
```
-#### As Javascript Date
-
-- Javascript の `Date` オブジェクトを返します
+### As Javascript Date `.toDate()`
-`Dayjs` オブジェクトから組み込みの `Date` オブジェクトのコピーを取得します。
+`Dayjs`オブジェクトをパースして複製したネイティブの`Date`オブジェクトを返します。
```js
-dayjs().toDate()
+dayjs('2019-01-25').toDate()
```
-#### As JSON
+### As JSON `.toJSON()`
-- JSON String を返します
-
-`Dayjs` オブジェクトを JSON シリアライズし、ISO8601 形式の日付文字列を返します。
+`Dayjs`オブジェクトの日付を ISO8601 形式にして文字列で返します。
```js
-dayjs().toJSON() //"2018-08-08T00:00:00.000Z"
+dayjs('2019-01-25').toJSON() // '2019-01-25T02:00:00.000Z'
```
-#### As ISO 8601 String
-
-- String を返します
+### As ISO 8601 String `.toISOString()`
-ISO8601 形式の文字列にフォーマットします。
+`Dayjs`オブジェクトの日付を ISO8601 形式にして文字列で返します。
```js
-dayjs().toISOString()
+dayjs('2019-01-25').toISOString() // '2019-01-25T02:00:00.000Z'
```
-#### As String
+### As String `.toString()`
-- String を返します
+日付を文字列で返します。
```js
-dayjs().toString()
+dayjs('2019-01-25').toString() // 'Fri, 25 Jan 2019 02:00:00 GMT'
```
----
+## Query
-### Query
+### Is Before `.isBefore(compared: Dayjs, unit?: string)`
-#### Is Before
-
-- Boolean を返します
-
-`Dayjs` オブジェクトが別の `Dayjs` オブジェクト以前の値かどうかを判定します。
+`Dayjs`オブジェクトの日付が、引数に与えた他の`Dayjs`オブジェクトの日付より前かどうかの真偽値を返します。
```js
-dayjs().isBefore(Dayjs, unit? : String);
-dayjs().isBefore(dayjs()); // false
-dayjs().isBefore(dayjs(), 'year'); // false
+dayjs().isBefore(dayjs()) // false
+dayjs().isBefore(dayjs(), 'year') // false
```
-#### Is Same
+### Is Same `.isSame(compared: Dayjs, unit?: string)`
-- Boolean を返します
-
-`Dayjs` オブジェクトが別の `Dayjs` オブジェクトの値と等しいかどうかを判定します。
+`Dayjs`オブジェクトの日付が、引数に与えた他の`Dayjs`オブジェクトの日付と同じかどうかの真偽値を返します。
```js
-dayjs().isSame(Dayjs, unit? : String);
-dayjs().isSame(dayjs()); // true
-dayjs().isSame(dayjs(), 'year'); // true
+dayjs().isSame(dayjs()) // true
+dayjs().isSame(dayjs(), 'year') // true
```
-#### Is After
-
-- Boolean を返します
+### Is After `.isAfter(compared: Dayjs, unit?: string)`
-`Dayjs` オブジェクトが別の `Dayjs` オブジェクト以降の値かどうかを判定します。
+`Dayjs`オブジェクトの日付が、引数に与えた他の`Dayjs`オブジェクトの日付より後かどうかの真偽値を返します。
```js
-dayjs().isAfter(Dayjs, unit? : String);
-dayjs().isAfter(dayjs()); // false
-dayjs().isAfter(dayjs(), 'year'); // false
+dayjs().isAfter(dayjs()) // false
+dayjs().isAfter(dayjs(), 'year') // false
```
-#### Is a Dayjs
+### Is a Dayjs `.isDayjs(compared: any)`
-- Boolean を返します
-
-与えられた値が `Dayjs` オブジェクトであるかどうかを判定します。
+引数に与えた変数が`Dayjs`オブジェクトかどうかの真偽値を返します。
```js
-dayjs.isDayjs(compared: any);
-dayjs.isDayjs(dayjs()); // true
-dayjs.isDayjs(new Date()); // false
+dayjs.isDayjs(dayjs()) // true
+dayjs.isDayjs(new Date()) // false
```
-The operator `instanceof` works equally well:
+`instanceof`オペレータでも同じように動作します。
```js
dayjs() instanceof dayjs // true
```
-### UTC
+## UTC
+
+UTC でパースや表示をしたい場合は、[`UTC`](./Plugin.md#utc)プラグインの`.utc` `.local` `.isUTC` で行えます。
+
+## Plugin APIs
+
+### RelativeTime
-If you want to parse or display in UTC, you can use `.utc` `.local` `.isUTC` with plugin [`UTC`](./Plugin.md#utc)
+`.from` `.to` `.fromNow` `.toNow` で相対時間が得られます。
-### Plugin APIs
+プラグイン [`RelativeTime`](./Plugin.md#relativetime)
-#### RelativeTime
+### IsLeapYear
-`.from` `.to` `.fromNow` `.toNow` は相対的な時刻を返します。
+`.isLeapYear` で閏年かどうかが得られます。
-plugin [`RelativeTime`](./Plugin.md#relativetime)
+プラグイン [`IsLeapYear`](./Plugin.md#isleapyear)
-#### IsLeapYear
+### WeekOfYear
-`.isLeapYear` はうるう年かどうかを返します。
+`.week` でその年における週数が得られます。
-plugin [`IsLeapYear`](./Plugin.md#isleapyear)
+プラグイン [`WeekOfYear`](./Plugin.md#weekofyear)
-#### WeekOfYear
+### WeekDay
-`.week` はその年の何週目かを返します。
+`.weekday` でロケールに対応した曜日の取得、設定ができます。
-plugin [`WeekOfYear`](./Plugin.md#weekofyear)
+プラグイン [`WeekDay`](./Plugin.md#weekday)
### IsoWeeksInYear
-`.isoWeeksInYear` to get the number of weeks in year
+`.isoWeeksInYear` でその年の週数が得られます。
-plugin [`IsoWeeksInYear`](./Plugin.md#isoweeksinyear)
+プラグイン [`IsoWeeksInYear`](./Plugin.md#isoweeksinyear)
-#### IsSameOrAfter
+### IsSameOrAfter
-`.isSameOrAfter` はある日付が別の日付と同じまたは以降かどうかを判定します。
+`.isSameOrAfter` で日付が別の日付と同じかそれより後であるかを得られます。
-plugin [`IsSameOrAfter`](./Plugin.md#issameorafter)
+プラグイン [`IsSameOrAfter`](./Plugin.md#issameorafter)
-#### IsSameOrBefore
+### IsSameOrBefore
-`.isSameOrBefore` はある日付が別の日付と同じまたは以前かどうか判定します。
+`.isSameOrBefore`で日付が別の日付と同じかそれより前であるかを得られます。
-plugin [`IsSameOrBefore`](./Plugin.md#issameorbefore)
+プラグイン [`IsSameOrBefore`](./Plugin.md#issameorbefore)
-#### IsBetween
+### IsBetween
-`.isBetween` はある日付が別の 2 つの日付の間にあるかどうかを判定します。
+`.isBetween`で他の 2 つの日付の間であるかどうかを得られます。
-plugin [`IsBetween`](./Plugin.md#isbetween)
+プラグイン [`IsBetween`](./Plugin.md#isbetween)
### QuarterOfYear
-`.quarter` to get quarter of the year
+`.quarter`で年の四半期のいつかが得られます。
-plugin [`QuarterOfYear`](./Plugin.md#quarterofyear)
+プラグイン [`QuarterOfYear`](./Plugin.md#quarterofyear)
### ToArray
-`.toArray` to return an `array` that mirrors the parameters
+`.toArray`でパラメータの配列が得られます。
-plugin [`ToArray`](./Plugin.md#toarray)
+プラグイン [`ToArray`](./Plugin.md#toarray)
### ToObject
-`.toObject` to return an `object` with the date's properties.
+`.toObject`でパラメータをキーに持ったオブジェクトが得られます。
-plugin [`ToObject`](./Plugin.md#toobject)
+プラグイン [`ToObject`](./Plugin.md#toobject)
### MinMax
-`.min` `.max` to compare given dayjs instances.
+`.min` `.max`で与えた複数の`Dayjs`インスタンスの中から最小もしくは最大のものが得られます。
-plugin [`MinMax`](./Plugin.md#minmax)
+プラグイン [`MinMax`](./Plugin.md#minmax)
### Calendar
-`.calendar` to display calendar time
+`.calendar`で与えた日付のカレンダー上の情報が得られます。
-plugin [`Calendar`](./Plugin.md#calendar)
+プラグイン [`Calendar`](./Plugin.md#calendar)
diff --git a/docs/ja/I18n.md b/docs/ja/I18n.md
index a53e646d..70f01350 100644
--- a/docs/ja/I18n.md
+++ b/docs/ja/I18n.md
@@ -108,6 +108,10 @@ const localeObject = {
MM: '%d months',
y: 'a year',
yy: '%d years'
+ },
+ meridiem: (hour, minute, isLowercase) => {
+ // OPTIONAL, AM/PM
+ return hour > 12 ? 'PM' : 'AM'
}
}
```
diff --git a/docs/ja/Plugin.md b/docs/ja/Plugin.md
index 2daa02cb..48767477 100644
--- a/docs/ja/Plugin.md
+++ b/docs/ja/Plugin.md
@@ -291,6 +291,19 @@ dayjs('06/27/2018').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.
diff --git a/docs/ko/API-reference.md b/docs/ko/API-reference.md
index efe06d52..c53303c4 100644
--- a/docs/ko/API-reference.md
+++ b/docs/ko/API-reference.md
@@ -454,6 +454,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
diff --git a/docs/ko/I18n.md b/docs/ko/I18n.md
index 9862f0d3..421b0529 100644
--- a/docs/ko/I18n.md
+++ b/docs/ko/I18n.md
@@ -107,6 +107,10 @@ const localeObject = {
MM: '%d months',
y: 'a year',
yy: '%d years'
+ },
+ meridiem: (hour, minute, isLowercase) => {
+ // OPTIONAL, AM/PM
+ return hour > 12 ? 'PM' : 'AM'
}
}
```
diff --git a/docs/ko/Plugin.md b/docs/ko/Plugin.md
index 25c70622..24e6f521 100644
--- a/docs/ko/Plugin.md
+++ b/docs/ko/Plugin.md
@@ -283,6 +283,19 @@ dayjs('06/27/2018').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.
diff --git a/docs/pt-br/API-reference.md b/docs/pt-br/API-reference.md
index 3617750c..9e3b8d9a 100644
--- a/docs/pt-br/API-reference.md
+++ b/docs/pt-br/API-reference.md
@@ -268,7 +268,7 @@ Retorna uma `string` com um objeto `Dayjs` contendo a data formatada.
Para escapar caracteres, envolva-os entre colchetes (por exemplo: `[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'
@@ -453,6 +453,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
diff --git a/docs/pt-br/I18n.md b/docs/pt-br/I18n.md
index 901b44c4..04aaa92f 100644
--- a/docs/pt-br/I18n.md
+++ b/docs/pt-br/I18n.md
@@ -122,6 +122,10 @@ const objetoLocale = {
MM: '%d months',
y: 'a year',
yy: '%d years'
+ },
+ meridiem: (hour, minute, isLowercase) => {
+ // OPTIONAL, AM/PM
+ return hour > 12 ? 'PM' : 'AM'
}
}
```
diff --git a/docs/pt-br/Plugin.md b/docs/pt-br/Plugin.md
index 676cff56..b264d51f 100644
--- a/docs/pt-br/Plugin.md
+++ b/docs/pt-br/Plugin.md
@@ -282,6 +282,19 @@ dayjs('06/27/2018').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.
diff --git a/docs/zh-cn/API-reference.md b/docs/zh-cn/API-reference.md
index 52d6a2ec..acc01f6c 100644
--- a/docs/zh-cn/API-reference.md
+++ b/docs/zh-cn/API-reference.md
@@ -259,7 +259,7 @@ dayjs().add(7, 'day');
#### 减少
-减少时间并返回一个新的 `Dayjs()` 对象,使用方法和 `dayjs#add` 相同。
+减少时间并返回一个新的 `Dayjs()` 对象。
```js
dayjs().subtract(value : Number, unit : String);
@@ -505,6 +505,12 @@ dayjs() instanceof dayjs // true
插件 [`WeekOfYear`](./Plugin.md#weekofyear)
+### 星期
+
+`.weekday` 来获取或设置当前语言的星期
+
+plugin [`WeekDay`](./Plugin.md#weekday)
+
### 年中有几周 ISO
`.isoWeeksInYear` 获得年中有几周
diff --git a/docs/zh-cn/I18n.md b/docs/zh-cn/I18n.md
index 8208bf81..ca9ebf70 100644
--- a/docs/zh-cn/I18n.md
+++ b/docs/zh-cn/I18n.md
@@ -108,6 +108,10 @@ const localeObject = {
MM: '%d months',
y: 'a year',
yy: '%d years'
+ },
+ meridiem: (hour, minute, isLowercase) => {
+ // 可选, AM/PM
+ return hour > 12 ? '下午' : '上午'
}
}
```
diff --git a/docs/zh-cn/Plugin.md b/docs/zh-cn/Plugin.md
index 6b82e2c3..171388d4 100644
--- a/docs/zh-cn/Plugin.md
+++ b/docs/zh-cn/Plugin.md
@@ -285,6 +285,19 @@ dayjs('06/27/2018').week() // 26
dayjs('2018-06-27').week(5) // 设置周
```
+### WeekDay
+
+- WeekDay 增加了 `.weekday()` API 来获取或设置当前语言的星期。
+
+```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 增加了 `.isoWeeksInYear()` API 返回一个 `number` 来得到依据 ISO week 标准一年中有几周
diff --git a/src/index.js b/src/index.js
index 8c8841a8..ccd0a95e 100644
--- a/src/index.js
+++ b/src/index.js
@@ -243,7 +243,7 @@ class Dayjs {
const unit = Utils.p(units)
const instanceFactorySet = (n) => {
const date = new Date(this.$d)
- date.setDate(date.getDate() + (n * number))
+ date.setDate(date.getDate() + Math.round(n * number))
return Utils.w(date, this)
}
if (unit === C.M) {
@@ -278,44 +278,50 @@ class Dayjs {
const str = formatStr || C.FORMAT_DEFAULT
const zoneStr = Utils.z(this)
const locale = this.$locale()
+ const { $H, $m, $M } = this
const {
- weekdays, months
+ weekdays, months, meridiem
} = locale
const getShort = (arr, index, full, length) => (
- (arr && arr[index]) || full[index].substr(0, length)
+ (arr && (arr[index] || arr(this, str))) || full[index].substr(0, length)
)
const get$H = num => (
- Utils.s(this.$H % 12 || 12, num, '0')
+ Utils.s($H % 12 || 12, num, '0')
)
+ const meridiemFunc = meridiem || ((hour, minute, isLowercase) => {
+ const m = (hour < 12 ? 'AM' : 'PM')
+ return isLowercase ? m.toLowerCase() : m
+ })
+
const matches = {
YY: String(this.$y).slice(-2),
- YYYY: String(this.$y),
- M: String(this.$M + 1),
- MM: Utils.s(this.$M + 1, 2, '0'),
- MMM: getShort(locale.monthsShort, this.$M, months, 3),
- MMMM: months[this.$M],
- D: String(this.$D),
+ YYYY: this.$y,
+ M: $M + 1,
+ MM: Utils.s($M + 1, 2, '0'),
+ MMM: getShort(locale.monthsShort, $M, months, 3),
+ MMMM: months[$M] || months(this, str),
+ D: this.$D,
DD: Utils.s(this.$D, 2, '0'),
- d: String(this.$W),
+ d: this.$W,
dd: getShort(locale.weekdaysMin, this.$W, weekdays, 2),
ddd: getShort(locale.weekdaysShort, this.$W, weekdays, 3),
dddd: weekdays[this.$W],
- H: String(this.$H),
- HH: Utils.s(this.$H, 2, '0'),
+ H: $H,
+ HH: Utils.s($H, 2, '0'),
h: get$H(1),
hh: get$H(2),
- a: this.$H < 12 ? 'am' : 'pm',
- A: this.$H < 12 ? 'AM' : 'PM',
- m: String(this.$m),
- mm: Utils.s(this.$m, 2, '0'),
- s: String(this.$s),
+ a: meridiemFunc($H, $m, true),
+ A: meridiemFunc($H, $m, false),
+ m: $m,
+ mm: Utils.s($m, 2, '0'),
+ s: this.$s,
ss: Utils.s(this.$s, 2, '0'),
SSS: Utils.s(this.$ms, 3, '0'),
Z: zoneStr // 'ZZ' logic below
}
- return str.replace(C.REGEX_FORMAT, (match, $1) => $1 || matches[match] || zoneStr.replace(':', '')) // 'ZZ'
+ return String(str.replace(C.REGEX_FORMAT, (match, $1) => $1 || matches[match] || zoneStr.replace(':', ''))) // 'ZZ'
}
utcOffset() {
diff --git a/src/locale/af.js b/src/locale/af.js
index e1bce5ac..ff7bd77d 100644
--- a/src/locale/af.js
+++ b/src/locale/af.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
monthsShort: 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
weekdaysMin: 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'oor %s',
+ past: '%s gelede',
+ s: "'n paar sekondes",
+ m: "'n minuut",
+ mm: '%d minute',
+ h: "'n uur",
+ hh: '%d ure',
+ d: "'n dag",
+ dd: '%d dae',
+ M: "'n maand",
+ MM: '%d maande',
+ y: "'n jaar",
+ yy: '%d jaar'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/ar-dz.js b/src/locale/ar-dz.js
index 651454eb..a97eb11c 100644
--- a/src/locale/ar-dz.js
+++ b/src/locale/ar-dz.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekdaysMin: 'أح_إث_ثلا_أر_خم_جم_سب'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'في %s',
+ past: 'منذ %s',
+ s: 'ثوان',
+ m: 'دقيقة',
+ mm: '%d دقائق',
+ h: 'ساعة',
+ hh: '%d ساعات',
+ d: 'يوم',
+ dd: '%d أيام',
+ M: 'شهر',
+ MM: '%d أشهر',
+ y: 'سنة',
+ yy: '%d سنوات'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/ar-kw.js b/src/locale/ar-kw.js
index 10670309..e431eda1 100644
--- a/src/locale/ar-kw.js
+++ b/src/locale/ar-kw.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'في %s',
+ past: 'منذ %s',
+ s: 'ثوان',
+ m: 'دقيقة',
+ mm: '%d دقائق',
+ h: 'ساعة',
+ hh: '%d ساعات',
+ d: 'يوم',
+ dd: '%d أيام',
+ M: 'شهر',
+ MM: '%d أشهر',
+ y: 'سنة',
+ yy: '%d سنوات'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/ar-ly.js b/src/locale/ar-ly.js
index 93236292..cfdf1327 100644
--- a/src/locale/ar-ly.js
+++ b/src/locale/ar-ly.js
@@ -8,7 +8,15 @@ const locale = {
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
monthsShort: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'D/M/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/ar-ma.js b/src/locale/ar-ma.js
index 819b06be..29007412 100644
--- a/src/locale/ar-ma.js
+++ b/src/locale/ar-ma.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'في %s',
+ past: 'منذ %s',
+ s: 'ثوان',
+ m: 'دقيقة',
+ mm: '%d دقائق',
+ h: 'ساعة',
+ hh: '%d ساعات',
+ d: 'يوم',
+ dd: '%d أيام',
+ M: 'شهر',
+ MM: '%d أشهر',
+ y: 'سنة',
+ yy: '%d سنوات'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/ar-sa.js b/src/locale/ar-sa.js
index 1801f27c..a619272e 100644
--- a/src/locale/ar-sa.js
+++ b/src/locale/ar-sa.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
monthsShort: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'في %s',
+ past: 'منذ %s',
+ s: 'ثوان',
+ m: 'دقيقة',
+ mm: '%d دقائق',
+ h: 'ساعة',
+ hh: '%d ساعات',
+ d: 'يوم',
+ dd: '%d أيام',
+ M: 'شهر',
+ MM: '%d أشهر',
+ y: 'سنة',
+ yy: '%d سنوات'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/ar-tn.js b/src/locale/ar-tn.js
index b84b8130..96b804c5 100644
--- a/src/locale/ar-tn.js
+++ b/src/locale/ar-tn.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'في %s',
+ past: 'منذ %s',
+ s: 'ثوان',
+ m: 'دقيقة',
+ mm: '%d دقائق',
+ h: 'ساعة',
+ hh: '%d ساعات',
+ d: 'يوم',
+ dd: '%d أيام',
+ M: 'شهر',
+ MM: '%d أشهر',
+ y: 'سنة',
+ yy: '%d سنوات'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/ar.js b/src/locale/ar.js
index 78534128..136431ca 100644
--- a/src/locale/ar.js
+++ b/src/locale/ar.js
@@ -20,9 +20,18 @@ const locale = {
y: 'عام واحد',
yy: 'أعوام %d'
},
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'D/M/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ }
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/az.js b/src/locale/az.js
index cddb2b85..c24f1b49 100644
--- a/src/locale/az.js
+++ b/src/locale/az.js
@@ -37,3 +37,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/be.js b/src/locale/be.js
index 6bc5dec9..80b47dd2 100644
--- a/src/locale/be.js
+++ b/src/locale/be.js
@@ -8,7 +8,15 @@ const locale = {
weekdaysShort: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
monthsShort: 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'),
weekdaysMin: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY г.',
+ LLL: 'D MMMM YYYY г., HH:mm',
+ LLLL: 'dddd, D MMMM YYYY г., HH:mm'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/bg.js b/src/locale/bg.js
index 29f33bd1..510bfd64 100644
--- a/src/locale/bg.js
+++ b/src/locale/bg.js
@@ -13,9 +13,25 @@ const locale = {
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY H:mm',
LLLL: 'dddd, D MMMM YYYY H:mm'
+ },
+ relativeTime: {
+ future: 'след %s',
+ past: 'преди %s',
+ s: 'няколко секунди',
+ m: 'минута',
+ mm: '%d минути',
+ h: 'час',
+ hh: '%d часа',
+ d: 'ден',
+ dd: '%d дни',
+ M: 'месец',
+ MM: '%d месеца',
+ y: 'година',
+ yy: '%d години'
}
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/bm.js b/src/locale/bm.js
index 911775ee..a8134cf0 100644
--- a/src/locale/bm.js
+++ b/src/locale/bm.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'),
monthsShort: 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'),
weekdaysMin: 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'MMMM [tile] D [san] YYYY',
+ LLL: 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
+ LLLL: 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm'
+ },
+ relativeTime: {
+ future: '%s kɔnɔ',
+ past: 'a bɛ %s bɔ',
+ s: 'sanga dama dama',
+ m: 'miniti kelen',
+ mm: 'miniti %d',
+ h: 'lɛrɛ kelen',
+ hh: 'lɛrɛ %d',
+ d: 'tile kelen',
+ dd: 'tile %d',
+ M: 'kalo kelen',
+ MM: 'kalo %d',
+ y: 'san kelen',
+ yy: 'san %d'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/bn.js b/src/locale/bn.js
index 1675bbf4..efed438a 100644
--- a/src/locale/bn.js
+++ b/src/locale/bn.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),
monthsShort: 'জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে'.split('_'),
weekdaysMin: 'রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'A h:mm সময়',
+ LTS: 'A h:mm:ss সময়',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm সময়',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm সময়'
+ },
+ relativeTime: {
+ future: '%s পরে',
+ past: '%s আগে',
+ s: 'কয়েক সেকেন্ড',
+ m: 'এক মিনিট',
+ mm: '%d মিনিট',
+ h: 'এক ঘন্টা',
+ hh: '%d ঘন্টা',
+ d: 'এক দিন',
+ dd: '%d দিন',
+ M: 'এক মাস',
+ MM: '%d মাস',
+ y: 'এক বছর',
+ yy: '%d বছর'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/bo.js b/src/locale/bo.js
index 73822257..9f213cb7 100644
--- a/src/locale/bo.js
+++ b/src/locale/bo.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
monthsShort: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
weekdaysMin: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'A h:mm',
+ LTS: 'A h:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm'
+ },
+ relativeTime: {
+ future: '%s ལ་',
+ past: '%s སྔན་ལ',
+ s: 'ལམ་སང',
+ m: 'སྐར་མ་གཅིག',
+ mm: '%d སྐར་མ',
+ h: 'ཆུ་ཚོད་གཅིག',
+ hh: '%d ཆུ་ཚོད',
+ d: 'ཉིན་གཅིག',
+ dd: '%d ཉིན་',
+ M: 'ཟླ་བ་གཅིག',
+ MM: '%d ཟླ་བ',
+ y: 'ལོ་གཅིག',
+ yy: '%d ལོ'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/br.js b/src/locale/br.js
index 7c935ac7..77cca151 100644
--- a/src/locale/br.js
+++ b/src/locale/br.js
@@ -8,7 +8,15 @@ const locale = {
weekdaysShort: 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
monthsShort: "Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split('_'),
weekdaysMin: 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'h[e]mm A',
+ LTS: 'h[e]mm:ss A',
+ L: 'DD/MM/YYYY',
+ LL: 'D [a viz] MMMM YYYY',
+ LLL: 'D [a viz] MMMM YYYY h[e]mm A',
+ LLLL: 'dddd, D [a viz] MMMM YYYY h[e]mm A'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/bs.js b/src/locale/bs.js
index 052a2a39..18bf2192 100644
--- a/src/locale/bs.js
+++ b/src/locale/bs.js
@@ -8,7 +8,15 @@ const locale = {
weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
monthsShort: 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'),
weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd, D. MMMM YYYY H:mm'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/ca.js b/src/locale/ca.js
index 8586d6d2..e7786707 100644
--- a/src/locale/ca.js
+++ b/src/locale/ca.js
@@ -37,3 +37,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/cs.js b/src/locale/cs.js
index 0260aa00..192e73e6 100644
--- a/src/locale/cs.js
+++ b/src/locale/cs.js
@@ -35,3 +35,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/cv.js b/src/locale/cv.js
index 1bddc845..37f44c64 100644
--- a/src/locale/cv.js
+++ b/src/locale/cv.js
@@ -8,7 +8,15 @@ const locale = {
weekdaysShort: 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),
monthsShort: 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),
weekdaysMin: 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD-MM-YYYY',
+ LL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',
+ LLL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
+ LLLL: 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/cy.js b/src/locale/cy.js
index 62e032fd..482a4410 100644
--- a/src/locale/cy.js
+++ b/src/locale/cy.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),
monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'),
weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'mewn %s',
+ past: '%s yn ôl',
+ s: 'ychydig eiliadau',
+ m: 'munud',
+ mm: '%d munud',
+ h: 'awr',
+ hh: '%d awr',
+ d: 'diwrnod',
+ dd: '%d diwrnod',
+ M: 'mis',
+ MM: '%d mis',
+ y: 'blwyddyn',
+ yy: '%d flynedd'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/da.js b/src/locale/da.js
index d1f78178..5d6e0c53 100644
--- a/src/locale/da.js
+++ b/src/locale/da.js
@@ -34,3 +34,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/de-at.js b/src/locale/de-at.js
index 11db724b..c39c6ca9 100644
--- a/src/locale/de-at.js
+++ b/src/locale/de-at.js
@@ -35,3 +35,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/de-ch.js b/src/locale/de-ch.js
index 49e5ac11..c4746cbc 100644
--- a/src/locale/de-ch.js
+++ b/src/locale/de-ch.js
@@ -8,7 +8,15 @@ const locale = {
weekdaysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY HH:mm',
+ LLLL: 'dddd, D. MMMM YYYY HH:mm'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/de.js b/src/locale/de.js
index 43b67bb8..b4d44a65 100644
--- a/src/locale/de.js
+++ b/src/locale/de.js
@@ -35,3 +35,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/dv.js b/src/locale/dv.js
index 590ff6cb..2aa5b675 100644
--- a/src/locale/dv.js
+++ b/src/locale/dv.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު'.split('_'),
monthsShort: 'ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު'.split('_'),
weekdaysMin: 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'D/M/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'ތެރޭގައި %s',
+ past: 'ކުރިން %s',
+ s: 'ސިކުންތުކޮޅެއް',
+ m: 'މިނިޓެއް',
+ mm: 'މިނިޓު %d',
+ h: 'ގަޑިއިރެއް',
+ hh: 'ގަޑިއިރު %d',
+ d: 'ދުވަހެއް',
+ dd: 'ދުވަސް %d',
+ M: 'މަހެއް',
+ MM: 'މަސް %d',
+ y: 'އަހަރެއް',
+ yy: 'އަހަރު %d'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/el.js b/src/locale/el.js
index 28319727..0f25fd54 100644
--- a/src/locale/el.js
+++ b/src/locale/el.js
@@ -21,9 +21,18 @@ const locale = {
MM: '%d μήνες',
y: 'ένα χρόνο',
yy: '%d χρόνια'
+ },
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY h:mm A',
+ LLLL: 'dddd, D MMMM YYYY h:mm A'
}
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/en-SG.js b/src/locale/en-SG.js
index 11805d52..50aed63a 100644
--- a/src/locale/en-SG.js
+++ b/src/locale/en-SG.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/en-au.js b/src/locale/en-au.js
index 4b35e771..71cba308 100644
--- a/src/locale/en-au.js
+++ b/src/locale/en-au.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY h:mm A',
+ LLLL: 'dddd, D MMMM YYYY h:mm A'
+ },
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/en-ca.js b/src/locale/en-ca.js
index a1411720..4c9b59eb 100644
--- a/src/locale/en-ca.js
+++ b/src/locale/en-ca.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'YYYY-MM-DD',
+ LL: 'MMMM D, YYYY',
+ LLL: 'MMMM D, YYYY h:mm A',
+ LLLL: 'dddd, MMMM D, YYYY h:mm A'
+ },
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/en-gb.js b/src/locale/en-gb.js
index 8d916abc..dfa84d2c 100644
--- a/src/locale/en-gb.js
+++ b/src/locale/en-gb.js
@@ -41,3 +41,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/en-ie.js b/src/locale/en-ie.js
index ae1f9815..94e592c2 100644
--- a/src/locale/en-ie.js
+++ b/src/locale/en-ie.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/en-il.js b/src/locale/en-il.js
index a1e1bfb6..e8787cc4 100644
--- a/src/locale/en-il.js
+++ b/src/locale/en-il.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/en-nz.js b/src/locale/en-nz.js
index 66f3d4c4..190d8974 100644
--- a/src/locale/en-nz.js
+++ b/src/locale/en-nz.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY h:mm A',
+ LLLL: 'dddd, D MMMM YYYY h:mm A'
+ },
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/eo.js b/src/locale/eo.js
index bc614465..9d3231e6 100644
--- a/src/locale/eo.js
+++ b/src/locale/eo.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'dim_lun_mard_merk_ĵaŭ_ven_sab'.split('_'),
monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'),
weekdaysMin: 'di_lu_ma_me_ĵa_ve_sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY-MM-DD',
+ LL: 'D[-a de] MMMM, YYYY',
+ LLL: 'D[-a de] MMMM, YYYY HH:mm',
+ LLLL: 'dddd, [la] D[-a de] MMMM, YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'post %s',
+ past: 'antaŭ %s',
+ s: 'sekundoj',
+ m: 'minuto',
+ mm: '%d minutoj',
+ h: 'horo',
+ hh: '%d horoj',
+ d: 'tago',
+ dd: '%d tagoj',
+ M: 'monato',
+ MM: '%d monatoj',
+ y: 'jaro',
+ yy: '%d jaroj'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/es-do.js b/src/locale/es-do.js
index 4b4ccb42..bb680ab3 100644
--- a/src/locale/es-do.js
+++ b/src/locale/es-do.js
@@ -23,9 +23,18 @@ const locale = {
y: 'un año',
yy: '%d años'
},
- ordinal: n => `${n}º`
+ ordinal: n => `${n}º`,
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'DD/MM/YYYY',
+ LL: 'D [de] MMMM [de] YYYY',
+ LLL: 'D [de] MMMM [de] YYYY h:mm A',
+ LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A'
+ }
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/es-us.js b/src/locale/es-us.js
index ba5b74d9..65959b70 100644
--- a/src/locale/es-us.js
+++ b/src/locale/es-us.js
@@ -22,9 +22,18 @@ const locale = {
y: 'un año',
yy: '%d años'
},
- ordinal: n => `${n}º`
+ ordinal: n => `${n}º`,
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'MM/DD/YYYY',
+ LL: 'D [de] MMMM [de] YYYY',
+ LLL: 'D [de] MMMM [de] YYYY h:mm A',
+ LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A'
+ }
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/es.js b/src/locale/es.js
index fb76b51c..4cb487f4 100644
--- a/src/locale/es.js
+++ b/src/locale/es.js
@@ -37,3 +37,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/et.js b/src/locale/et.js
index c4e5a145..b9d8e18e 100644
--- a/src/locale/et.js
+++ b/src/locale/et.js
@@ -31,9 +31,18 @@ const locale = {
MM: '%d kuud', // for past tense
y: 'aasta', // for past tense
yy: '%d aastat' // for past tense
+ },
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd, D. MMMM YYYY H:mm'
}
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/eu.js b/src/locale/eu.js
index 5106811c..3433a75c 100644
--- a/src/locale/eu.js
+++ b/src/locale/eu.js
@@ -8,7 +8,34 @@ const locale = {
weekdaysShort: 'ig._al._ar._az._og._ol._lr.'.split('_'),
monthsShort: 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'),
weekdaysMin: 'ig_al_ar_az_og_ol_lr'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY-MM-DD',
+ LL: 'YYYY[ko] MMMM[ren] D[a]',
+ LLL: 'YYYY[ko] MMMM[ren] D[a] HH:mm',
+ LLLL: 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',
+ l: 'YYYY-M-D',
+ ll: 'YYYY[ko] MMM D[a]',
+ lll: 'YYYY[ko] MMM D[a] HH:mm',
+ llll: 'ddd, YYYY[ko] MMM D[a] HH:mm'
+ },
+ relativeTime: {
+ future: '%s barru',
+ past: 'duela %s',
+ s: 'segundo batzuk',
+ m: 'minutu bat',
+ mm: '%d minutu',
+ h: 'ordu bat',
+ hh: '%d ordu',
+ d: 'egun bat',
+ dd: '%d egun',
+ M: 'hilabete bat',
+ MM: '%d hilabete',
+ y: 'urte bat',
+ yy: '%d urte'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/fa.js b/src/locale/fa.js
index 09d1d084..7a6a1ba3 100644
--- a/src/locale/fa.js
+++ b/src/locale/fa.js
@@ -33,3 +33,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/fi.js b/src/locale/fi.js
index f1f41089..238636b2 100644
--- a/src/locale/fi.js
+++ b/src/locale/fi.js
@@ -50,3 +50,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/fo.js b/src/locale/fo.js
index a8d3b6ff..c51dcb36 100644
--- a/src/locale/fo.js
+++ b/src/locale/fo.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'sun_mán_týs_mik_hós_frí_ley'.split('_'),
monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
weekdaysMin: 'su_má_tý_mi_hó_fr_le'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D. MMMM, YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'um %s',
+ past: '%s síðani',
+ s: 'fá sekund',
+ m: 'ein minuttur',
+ mm: '%d minuttir',
+ h: 'ein tími',
+ hh: '%d tímar',
+ d: 'ein dagur',
+ dd: '%d dagar',
+ M: 'ein mánaður',
+ MM: '%d mánaðir',
+ y: 'eitt ár',
+ yy: '%d ár'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/fr-ca.js b/src/locale/fr-ca.js
index 4bf3b01f..b03ba84b 100644
--- a/src/locale/fr-ca.js
+++ b/src/locale/fr-ca.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY-MM-DD',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'dans %s',
+ past: 'il y a %s',
+ s: 'quelques secondes',
+ m: 'une minute',
+ mm: '%d minutes',
+ h: 'une heure',
+ hh: '%d heures',
+ d: 'un jour',
+ dd: '%d jours',
+ M: 'un mois',
+ MM: '%d mois',
+ y: 'un an',
+ yy: '%d ans'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/fr-ch.js b/src/locale/fr-ch.js
index 4f8c42a1..e917818f 100644
--- a/src/locale/fr-ch.js
+++ b/src/locale/fr-ch.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'dans %s',
+ past: 'il y a %s',
+ s: 'quelques secondes',
+ m: 'une minute',
+ mm: '%d minutes',
+ h: 'une heure',
+ hh: '%d heures',
+ d: 'un jour',
+ dd: '%d jours',
+ M: 'un mois',
+ MM: '%d mois',
+ y: 'un an',
+ yy: '%d ans'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/fr.js b/src/locale/fr.js
index f4f374bc..e7c1a9b8 100644
--- a/src/locale/fr.js
+++ b/src/locale/fr.js
@@ -38,3 +38,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/fy.js b/src/locale/fy.js
index 309fd0c4..37161214 100644
--- a/src/locale/fy.js
+++ b/src/locale/fy.js
@@ -7,7 +7,30 @@ const locale = {
weekStart: 1,
weekdaysShort: 'si._mo._ti._wo._to._fr._so.'.split('_'),
weekdaysMin: 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD-MM-YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'oer %s',
+ past: '%s lyn',
+ s: 'in pear sekonden',
+ m: 'ien minút',
+ mm: '%d minuten',
+ h: 'ien oere',
+ hh: '%d oeren',
+ d: 'ien dei',
+ dd: '%d dagen',
+ M: 'ien moanne',
+ MM: '%d moannen',
+ y: 'ien jier',
+ yy: '%d jierren'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/ga.js b/src/locale/ga.js
index dd7271b5..36a8bb67 100644
--- a/src/locale/ga.js
+++ b/src/locale/ga.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Dom_Lua_Mái_Céa_Déa_hAo_Sat'.split('_'),
monthsShort: 'Eaná_Feab_Márt_Aibr_Beal_Méit_Iúil_Lúna_Meán_Deai_Samh_Noll'.split('_'),
weekdaysMin: 'Do_Lu_Má_Ce_Dé_hA_Sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'i %s',
+ past: '%s ó shin',
+ s: 'cúpla soicind',
+ m: 'nóiméad',
+ mm: '%d nóiméad',
+ h: 'uair an chloig',
+ hh: '%d uair an chloig',
+ d: 'lá',
+ dd: '%d lá',
+ M: 'mí',
+ MM: '%d mí',
+ y: 'bliain',
+ yy: '%d bliain'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/gd.js b/src/locale/gd.js
index 89724db9..bca10329 100644
--- a/src/locale/gd.js
+++ b/src/locale/gd.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Did_Dil_Dim_Dic_Dia_Dih_Dis'.split('_'),
monthsShort: 'Faoi_Gear_Màrt_Gibl_Cèit_Ògmh_Iuch_Lùn_Sult_Dàmh_Samh_Dùbh'.split('_'),
weekdaysMin: 'Dò_Lu_Mà_Ci_Ar_Ha_Sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'ann an %s',
+ past: 'bho chionn %s',
+ s: 'beagan diogan',
+ m: 'mionaid',
+ mm: '%d mionaidean',
+ h: 'uair',
+ hh: '%d uairean',
+ d: 'latha',
+ dd: '%d latha',
+ M: 'mìos',
+ MM: '%d mìosan',
+ y: 'bliadhna',
+ yy: '%d bliadhna'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/gl.js b/src/locale/gl.js
index d1619d36..e9f1bb47 100644
--- a/src/locale/gl.js
+++ b/src/locale/gl.js
@@ -8,7 +8,15 @@ const locale = {
weekdaysShort: 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),
monthsShort: 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split('_'),
weekdaysMin: 'do_lu_ma_mé_xo_ve_sá'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D [de] MMMM [de] YYYY',
+ LLL: 'D [de] MMMM [de] YYYY H:mm',
+ LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/gom-latn.js b/src/locale/gom-latn.js
index 77200409..44b049da 100644
--- a/src/locale/gom-latn.js
+++ b/src/locale/gom-latn.js
@@ -8,7 +8,16 @@ const locale = {
weekdaysShort: 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'),
monthsShort: 'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split('_'),
weekdaysMin: 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'A h:mm [vazta]',
+ LTS: 'A h:mm:ss [vazta]',
+ L: 'DD-MM-YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY A h:mm [vazta]',
+ LLLL: 'dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]',
+ llll: 'ddd, D MMM YYYY, A h:mm [vazta]'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/gu.js b/src/locale/gu.js
index 37cc5800..cef55454 100644
--- a/src/locale/gu.js
+++ b/src/locale/gu.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'),
monthsShort: 'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split('_'),
weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'A h:mm વાગ્યે',
+ LTS: 'A h:mm:ss વાગ્યે',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm વાગ્યે',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે'
+ },
+ relativeTime: {
+ future: '%s મા',
+ past: '%s પેહલા',
+ s: 'અમુક પળો',
+ m: 'એક મિનિટ',
+ mm: '%d મિનિટ',
+ h: 'એક કલાક',
+ hh: '%d કલાક',
+ d: 'એક દિવસ',
+ dd: '%d દિવસ',
+ M: 'એક મહિનો',
+ MM: '%d મહિનો',
+ y: 'એક વર્ષ',
+ yy: '%d વર્ષ'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/he.js b/src/locale/he.js
index b9353760..03eeb6ff 100644
--- a/src/locale/he.js
+++ b/src/locale/he.js
@@ -33,9 +33,22 @@ const locale = {
ll: 'D MMM YYYY',
lll: 'D MMM YYYY HH:mm',
llll: 'ddd, D MMM YYYY HH:mm'
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D [ב]MMMM YYYY',
+ LLL: 'D [ב]MMMM YYYY HH:mm',
+ LLLL: 'dddd, D [ב]MMMM YYYY HH:mm',
+ l: 'D/M/YYYY',
+ ll: 'D MMM YYYY',
+ lll: 'D MMM YYYY HH:mm',
+ llll: 'ddd, D MMM YYYY HH:mm'
}
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/hi.js b/src/locale/hi.js
index f8e181a4..d303175f 100644
--- a/src/locale/hi.js
+++ b/src/locale/hi.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
monthsShort: 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),
weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'A h:mm बजे',
+ LTS: 'A h:mm:ss बजे',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm बजे',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm बजे'
+ },
+ relativeTime: {
+ future: '%s में',
+ past: '%s पहले',
+ s: 'कुछ ही क्षण',
+ m: 'एक मिनट',
+ mm: '%d मिनट',
+ h: 'एक घंटा',
+ hh: '%d घंटे',
+ d: 'एक दिन',
+ dd: '%d दिन',
+ M: 'एक महीने',
+ MM: '%d महीने',
+ y: 'एक वर्ष',
+ yy: '%d वर्ष'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/hr.js b/src/locale/hr.js
index 62114f74..10823e58 100644
--- a/src/locale/hr.js
+++ b/src/locale/hr.js
@@ -34,3 +34,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/hu.js b/src/locale/hu.js
index ff527e05..98ca649e 100644
--- a/src/locale/hu.js
+++ b/src/locale/hu.js
@@ -23,9 +23,18 @@ const locale = {
MM: '%d hónap',
y: 'egy éve',
yy: '%d év'
+ },
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'YYYY.MM.DD.',
+ LL: 'YYYY. MMMM D.',
+ LLL: 'YYYY. MMMM D. H:mm',
+ LLLL: 'YYYY. MMMM D., dddd H:mm'
}
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/hy-am.js b/src/locale/hy-am.js
index aeaf6770..f8440bc8 100644
--- a/src/locale/hy-am.js
+++ b/src/locale/hy-am.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
monthsShort: 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),
weekdaysMin: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY թ.',
+ LLL: 'D MMMM YYYY թ., HH:mm',
+ LLLL: 'dddd, D MMMM YYYY թ., HH:mm'
+ },
+ relativeTime: {
+ future: '%s հետո',
+ past: '%s առաջ',
+ s: 'մի քանի վայրկյան',
+ m: 'րոպե',
+ mm: '%d րոպե',
+ h: 'ժամ',
+ hh: '%d ժամ',
+ d: 'օր',
+ dd: '%d օր',
+ M: 'ամիս',
+ MM: '%d ամիս',
+ y: 'տարի',
+ yy: '%d տարի'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/id.js b/src/locale/id.js
index 6916abf1..32175f4a 100644
--- a/src/locale/id.js
+++ b/src/locale/id.js
@@ -4,6 +4,9 @@ const locale = {
name: 'id',
weekdays: 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),
+ weekdaysShort: 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
+ monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des'.split('_'),
+ weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
weekStart: 1,
formats: {
LT: 'HH.mm',
@@ -34,3 +37,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/is.js b/src/locale/is.js
index 9ae4c540..300e07c6 100644
--- a/src/locale/is.js
+++ b/src/locale/is.js
@@ -8,7 +8,15 @@ const locale = {
weekdaysShort: 'sun_mán_þri_mið_fim_fös_lau'.split('_'),
monthsShort: 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),
weekdaysMin: 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY [kl.] H:mm',
+ LLLL: 'dddd, D. MMMM YYYY [kl.] H:mm'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/it-ch.js b/src/locale/it-ch.js
index 8e164779..b007df64 100644
--- a/src/locale/it-ch.js
+++ b/src/locale/it-ch.js
@@ -8,7 +8,15 @@ const locale = {
weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/it.js b/src/locale/it.js
index dfbf8ff2..06e802e0 100644
--- a/src/locale/it.js
+++ b/src/locale/it.js
@@ -37,3 +37,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/ja.js b/src/locale/ja.js
index 72520a7c..2d2d2dbe 100644
--- a/src/locale/ja.js
+++ b/src/locale/ja.js
@@ -19,6 +19,7 @@ const locale = {
lll: 'YYYY年M月D日 HH:mm',
llll: 'YYYY年M月D日(ddd) HH:mm'
},
+ meridiem: hour => (hour < 12 ? '午前' : '午後'),
relativeTime: {
future: '%s後',
past: '%s前',
@@ -39,3 +40,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/jv.js b/src/locale/jv.js
index 589df04d..046c5899 100644
--- a/src/locale/jv.js
+++ b/src/locale/jv.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),
monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),
weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH.mm',
+ LTS: 'HH.mm.ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY [pukul] HH.mm',
+ LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm'
+ },
+ relativeTime: {
+ future: 'wonten ing %s',
+ past: '%s ingkang kepengker',
+ s: 'sawetawis detik',
+ m: 'setunggal menit',
+ mm: '%d menit',
+ h: 'setunggal jam',
+ hh: '%d jam',
+ d: 'sedinten',
+ dd: '%d dinten',
+ M: 'sewulan',
+ MM: '%d wulan',
+ y: 'setaun',
+ yy: '%d taun'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/ka.js b/src/locale/ka.js
index 002e1c65..73959f6d 100644
--- a/src/locale/ka.js
+++ b/src/locale/ka.js
@@ -34,3 +34,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/kk.js b/src/locale/kk.js
index 6e722f92..0cec380d 100644
--- a/src/locale/kk.js
+++ b/src/locale/kk.js
@@ -23,9 +23,18 @@ const locale = {
y: 'бір жыл',
yy: '%d жыл'
},
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ }
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/km.js b/src/locale/km.js
index abee86d7..424ff919 100644
--- a/src/locale/km.js
+++ b/src/locale/km.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: '%sទៀត',
+ past: '%sមុន',
+ s: 'ប៉ុន្មានវិនាទី',
+ m: 'មួយនាទី',
+ mm: '%d នាទី',
+ h: 'មួយម៉ោង',
+ hh: '%d ម៉ោង',
+ d: 'មួយថ្ងៃ',
+ dd: '%d ថ្ងៃ',
+ M: 'មួយខែ',
+ MM: '%d ខែ',
+ y: 'មួយឆ្នាំ',
+ yy: '%d ឆ្នាំ'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/kn.js b/src/locale/kn.js
index d8da1f9a..ba214ba0 100644
--- a/src/locale/kn.js
+++ b/src/locale/kn.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ'.split('_'),
monthsShort: 'ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ'.split('_'),
weekdaysMin: 'ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'A h:mm',
+ LTS: 'A h:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm'
+ },
+ relativeTime: {
+ future: '%s ನಂತರ',
+ past: '%s ಹಿಂದೆ',
+ s: 'ಕೆಲವು ಕ್ಷಣಗಳು',
+ m: 'ಒಂದು ನಿಮಿಷ',
+ mm: '%d ನಿಮಿಷ',
+ h: 'ಒಂದು ಗಂಟೆ',
+ hh: '%d ಗಂಟೆ',
+ d: 'ಒಂದು ದಿನ',
+ dd: '%d ದಿನ',
+ M: 'ಒಂದು ತಿಂಗಳು',
+ MM: '%d ತಿಂಗಳು',
+ y: 'ಒಂದು ವರ್ಷ',
+ yy: '%d ವರ್ಷ'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/ko.js b/src/locale/ko.js
index 04cbae8f..6d5bd048 100644
--- a/src/locale/ko.js
+++ b/src/locale/ko.js
@@ -38,3 +38,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/ku.js b/src/locale/ku.js
index 26678a10..66fb60ac 100644
--- a/src/locale/ku.js
+++ b/src/locale/ku.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'یهكشهم_دووشهم_سێشهم_چوارشهم_پێنجشهم_ههینی_شهممه'.split('_'),
monthsShort: 'کانونی دووەم_شوبات_ئازار_نیسان_ئایار_حوزەیران_تەمموز_ئاب_ئەیلوول_تشرینی یەكەم_تشرینی دووەم_كانونی یەکەم'.split('_'),
weekdaysMin: 'ی_د_س_چ_پ_ه_ش'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'له %s',
+ past: '%s',
+ s: 'چهند چركهیهك',
+ m: 'یهك خولهك',
+ mm: '%d خولهك',
+ h: 'یهك كاتژمێر',
+ hh: '%d كاتژمێر',
+ d: 'یهك ڕۆژ',
+ dd: '%d ڕۆژ',
+ M: 'یهك مانگ',
+ MM: '%d مانگ',
+ y: 'یهك ساڵ',
+ yy: '%d ساڵ'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/ky.js b/src/locale/ky.js
index 2119777b..417df4cc 100644
--- a/src/locale/ky.js
+++ b/src/locale/ky.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),
monthsShort: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'),
weekdaysMin: 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: '%s ичинде',
+ past: '%s мурун',
+ s: 'бирнече секунд',
+ m: 'бир мүнөт',
+ mm: '%d мүнөт',
+ h: 'бир саат',
+ hh: '%d саат',
+ d: 'бир күн',
+ dd: '%d күн',
+ M: 'бир ай',
+ MM: '%d ай',
+ y: 'бир жыл',
+ yy: '%d жыл'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/lb.js b/src/locale/lb.js
index 173b4592..533ee733 100644
--- a/src/locale/lb.js
+++ b/src/locale/lb.js
@@ -8,7 +8,15 @@ const locale = {
weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'H:mm [Auer]',
+ LTS: 'H:mm:ss [Auer]',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm [Auer]',
+ LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/lo.js b/src/locale/lo.js
index 6b654aa2..7a4eafcb 100644
--- a/src/locale/lo.js
+++ b/src/locale/lo.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
monthsShort: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'),
weekdaysMin: 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'ວັນdddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'ອີກ %s',
+ past: '%sຜ່ານມາ',
+ s: 'ບໍ່ເທົ່າໃດວິນາທີ',
+ m: '1 ນາທີ',
+ mm: '%d ນາທີ',
+ h: '1 ຊົ່ວໂມງ',
+ hh: '%d ຊົ່ວໂມງ',
+ d: '1 ມື້',
+ dd: '%d ມື້',
+ M: '1 ເດືອນ',
+ MM: '%d ເດືອນ',
+ y: '1 ປີ',
+ yy: '%d ປີ'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/lt.js b/src/locale/lt.js
index 9c209185..add5d4b1 100644
--- a/src/locale/lt.js
+++ b/src/locale/lt.js
@@ -32,9 +32,22 @@ const locale = {
ll: 'YYYY [m.] MMMM D [d.]',
lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]'
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY-MM-DD',
+ LL: 'YYYY [m.] MMMM D [d.]',
+ LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
+ LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
+ l: 'YYYY-MM-DD',
+ ll: 'YYYY [m.] MMMM D [d.]',
+ lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
+ llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]'
}
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/lv.js b/src/locale/lv.js
index e9cbe952..55abd963 100644
--- a/src/locale/lv.js
+++ b/src/locale/lv.js
@@ -8,7 +8,15 @@ const locale = {
weekdaysShort: 'Sv_P_O_T_C_Pk_S'.split('_'),
monthsShort: 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
weekdaysMin: 'Sv_P_O_T_C_Pk_S'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY.',
+ LL: 'YYYY. [gada] D. MMMM',
+ LLL: 'YYYY. [gada] D. MMMM, HH:mm',
+ LLLL: 'YYYY. [gada] D. MMMM, dddd, HH:mm'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/me.js b/src/locale/me.js
index 936bf79d..d0cad96e 100644
--- a/src/locale/me.js
+++ b/src/locale/me.js
@@ -8,7 +8,15 @@ const locale = {
weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'),
weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd, D. MMMM YYYY H:mm'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/mi.js b/src/locale/mi.js
index 04e86c84..443d13aa 100644
--- a/src/locale/mi.js
+++ b/src/locale/mi.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
monthsShort: 'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split('_'),
weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY [i] HH:mm',
+ LLLL: 'dddd, D MMMM YYYY [i] HH:mm'
+ },
+ relativeTime: {
+ future: 'i roto i %s',
+ past: '%s i mua',
+ s: 'te hēkona ruarua',
+ m: 'he meneti',
+ mm: '%d meneti',
+ h: 'te haora',
+ hh: '%d haora',
+ d: 'he ra',
+ dd: '%d ra',
+ M: 'he marama',
+ MM: '%d marama',
+ y: 'he tau',
+ yy: '%d tau'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/mk.js b/src/locale/mk.js
index 0fc8636c..0029b914 100644
--- a/src/locale/mk.js
+++ b/src/locale/mk.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'нед_пон_вто_сре_чет_пет_саб'.split('_'),
monthsShort: 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),
weekdaysMin: 'нe_пo_вт_ср_че_пе_сa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'D.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY H:mm',
+ LLLL: 'dddd, D MMMM YYYY H:mm'
+ },
+ relativeTime: {
+ future: 'после %s',
+ past: 'пред %s',
+ s: 'неколку секунди',
+ m: 'минута',
+ mm: '%d минути',
+ h: 'час',
+ hh: '%d часа',
+ d: 'ден',
+ dd: '%d дена',
+ M: 'месец',
+ MM: '%d месеци',
+ y: 'година',
+ yy: '%d години'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/ml.js b/src/locale/ml.js
index 813b49f0..fc1ec2cf 100644
--- a/src/locale/ml.js
+++ b/src/locale/ml.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),
monthsShort: 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'),
weekdaysMin: 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'A h:mm -നു',
+ LTS: 'A h:mm:ss -നു',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm -നു',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm -നു'
+ },
+ relativeTime: {
+ future: '%s കഴിഞ്ഞ്',
+ past: '%s മുൻപ്',
+ s: 'അൽപ നിമിഷങ്ങൾ',
+ m: 'ഒരു മിനിറ്റ്',
+ mm: '%d മിനിറ്റ്',
+ h: 'ഒരു മണിക്കൂർ',
+ hh: '%d മണിക്കൂർ',
+ d: 'ഒരു ദിവസം',
+ dd: '%d ദിവസം',
+ M: 'ഒരു മാസം',
+ MM: '%d മാസം',
+ y: 'ഒരു വർഷം',
+ yy: '%d വർഷം'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/mn.js b/src/locale/mn.js
index c3883590..a2c863a9 100644
--- a/src/locale/mn.js
+++ b/src/locale/mn.js
@@ -7,7 +7,15 @@ const locale = {
weekdaysShort: 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'),
monthsShort: '1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split('_'),
weekdaysMin: 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY-MM-DD',
+ LL: 'YYYY оны MMMMын D',
+ LLL: 'YYYY оны MMMMын D HH:mm',
+ LLLL: 'dddd, YYYY оны MMMMын D HH:mm'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/mr.js b/src/locale/mr.js
index 350136f3..d58ed4ee 100644
--- a/src/locale/mr.js
+++ b/src/locale/mr.js
@@ -7,7 +7,15 @@ const locale = {
weekdaysShort: 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),
monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'),
weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'A h:mm वाजता',
+ LTS: 'A h:mm:ss वाजता',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm वाजता',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm वाजता'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/ms-my.js b/src/locale/ms-my.js
index 5e448de8..225dc148 100644
--- a/src/locale/ms-my.js
+++ b/src/locale/ms-my.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH.mm',
+ LTS: 'HH.mm.ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY [pukul] HH.mm',
+ LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm'
+ },
+ relativeTime: {
+ future: 'dalam %s',
+ past: '%s yang lepas',
+ s: 'beberapa saat',
+ m: 'seminit',
+ mm: '%d minit',
+ h: 'sejam',
+ hh: '%d jam',
+ d: 'sehari',
+ dd: '%d hari',
+ M: 'sebulan',
+ MM: '%d bulan',
+ y: 'setahun',
+ yy: '%d tahun'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/ms.js b/src/locale/ms.js
index 740b95b3..89d4a5ac 100644
--- a/src/locale/ms.js
+++ b/src/locale/ms.js
@@ -34,3 +34,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/mt.js b/src/locale/mt.js
index 418de824..b339413e 100644
--- a/src/locale/mt.js
+++ b/src/locale/mt.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib'.split('_'),
monthsShort: 'Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ'.split('_'),
weekdaysMin: 'Ħa_Tn_Tl_Er_Ħa_Ġi_Si'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'f’ %s',
+ past: '%s ilu',
+ s: 'ftit sekondi',
+ m: 'minuta',
+ mm: '%d minuti',
+ h: 'siegħa',
+ hh: '%d siegħat',
+ d: 'ġurnata',
+ dd: '%d ġranet',
+ M: 'xahar',
+ MM: '%d xhur',
+ y: 'sena',
+ yy: '%d sni'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/my.js b/src/locale/my.js
index 5478cf48..3ba8999c 100644
--- a/src/locale/my.js
+++ b/src/locale/my.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),
weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'လာမည့် %s မှာ',
+ past: 'လွန်ခဲ့သော %s က',
+ s: 'စက္ကန်.အနည်းငယ်',
+ m: 'တစ်မိနစ်',
+ mm: '%d မိနစ်',
+ h: 'တစ်နာရီ',
+ hh: '%d နာရီ',
+ d: 'တစ်ရက်',
+ dd: '%d ရက်',
+ M: 'တစ်လ',
+ MM: '%d လ',
+ y: 'တစ်နှစ်',
+ yy: '%d နှစ်'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/nb.js b/src/locale/nb.js
index 54fb2a2f..a7dd0bce 100644
--- a/src/locale/nb.js
+++ b/src/locale/nb.js
@@ -34,3 +34,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/ne.js b/src/locale/ne.js
index 1fdd171b..07a79712 100644
--- a/src/locale/ne.js
+++ b/src/locale/ne.js
@@ -19,9 +19,18 @@ const locale = {
y: 'एक वर्ष',
yy: '%d वर्ष'
},
- ordinal: n => `${n}`.replace(/\d/g, i => '०१२३४५६७८९'[i])
+ ordinal: n => `${n}`.replace(/\d/g, i => '०१२३४५६७८९'[i]),
+ formats: {
+ LT: 'Aको h:mm बजे',
+ LTS: 'Aको h:mm:ss बजे',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, Aको h:mm बजे',
+ LLLL: 'dddd, D MMMM YYYY, Aको h:mm बजे'
+ }
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/nl-be.js b/src/locale/nl-be.js
index 64d545ca..c45816da 100644
--- a/src/locale/nl-be.js
+++ b/src/locale/nl-be.js
@@ -7,7 +7,30 @@ const locale = {
weekStart: 1,
weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'over %s',
+ past: '%s geleden',
+ s: 'een paar seconden',
+ m: 'één minuut',
+ mm: '%d minuten',
+ h: 'één uur',
+ hh: '%d uur',
+ d: 'één dag',
+ dd: '%d dagen',
+ M: 'één maand',
+ MM: '%d maanden',
+ y: 'één jaar',
+ yy: '%d jaar'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/nl.js b/src/locale/nl.js
index ad95d816..8739297b 100644
--- a/src/locale/nl.js
+++ b/src/locale/nl.js
@@ -34,3 +34,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/nn.js b/src/locale/nn.js
index 40df77cc..c48e22b4 100644
--- a/src/locale/nn.js
+++ b/src/locale/nn.js
@@ -23,9 +23,18 @@ const locale = {
MM: '%d månadar',
y: 'eitt år',
yy: '%d år'
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY [kl.] H:mm',
+ LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm'
}
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/pa-in.js b/src/locale/pa-in.js
index d1774fa2..a2456346 100644
--- a/src/locale/pa-in.js
+++ b/src/locale/pa-in.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
monthsShort: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'),
weekdaysMin: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'A h:mm ਵਜੇ',
+ LTS: 'A h:mm:ss ਵਜੇ',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm ਵਜੇ',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm ਵਜੇ'
+ },
+ relativeTime: {
+ future: '%s ਵਿੱਚ',
+ past: '%s ਪਿਛਲੇ',
+ s: 'ਕੁਝ ਸਕਿੰਟ',
+ m: 'ਇਕ ਮਿੰਟ',
+ mm: '%d ਮਿੰਟ',
+ h: 'ਇੱਕ ਘੰਟਾ',
+ hh: '%d ਘੰਟੇ',
+ d: 'ਇੱਕ ਦਿਨ',
+ dd: '%d ਦਿਨ',
+ M: 'ਇੱਕ ਮਹੀਨਾ',
+ MM: '%d ਮਹੀਨੇ',
+ y: 'ਇੱਕ ਸਾਲ',
+ yy: '%d ਸਾਲ'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/pl.js b/src/locale/pl.js
index 939d5bd2..49b9fc1b 100644
--- a/src/locale/pl.js
+++ b/src/locale/pl.js
@@ -22,9 +22,18 @@ const locale = {
MM: '%d miesięcy',
y: 'rok',
yy: '%d lat'
+ },
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
}
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/pt-br.js b/src/locale/pt-br.js
index 3ac0c250..245a21a1 100644
--- a/src/locale/pt-br.js
+++ b/src/locale/pt-br.js
@@ -33,3 +33,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/pt.js b/src/locale/pt.js
index 32839746..f9e70f10 100644
--- a/src/locale/pt.js
+++ b/src/locale/pt.js
@@ -36,3 +36,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/ro.js b/src/locale/ro.js
index 45f2348c..dc0033ef 100644
--- a/src/locale/ro.js
+++ b/src/locale/ro.js
@@ -34,3 +34,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/ru.js b/src/locale/ru.js
index 12714d1d..d8911c71 100644
--- a/src/locale/ru.js
+++ b/src/locale/ru.js
@@ -1,12 +1,29 @@
import dayjs from 'dayjs'
+const monthFormat = 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_')
+const monthStandalone = 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_')
+
+const monthShortFormat = 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_')
+const monthShortStandalone = 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_')
+
+const MONTHS_IN_FORMAT = /D[oD]?(\[[^[\]]*\]|\s)+MMMM?/
const locale = {
name: 'ru',
weekdays: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
weekdaysShort: 'вск_пнд_втр_срд_чтв_птн_сбт'.split('_'),
weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
- months: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
- monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
+ months: (dayjsInstance, format) => {
+ if (MONTHS_IN_FORMAT.test(format)) {
+ return monthFormat[dayjsInstance.month()]
+ }
+ return monthStandalone[dayjsInstance.month()]
+ },
+ monthsShort: (dayjsInstance, format) => {
+ if (MONTHS_IN_FORMAT.test(format)) {
+ return monthShortFormat[dayjsInstance.month()]
+ }
+ return monthShortStandalone[dayjsInstance.month()]
+ },
weekStart: 1,
formats: {
LT: 'H:mm',
@@ -37,3 +54,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/sd.js b/src/locale/sd.js
index 000e816f..e781057e 100644
--- a/src/locale/sd.js
+++ b/src/locale/sd.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر'.split('_'),
monthsShort: 'جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر'.split('_'),
weekdaysMin: 'آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd، D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: '%s پوء',
+ past: '%s اڳ',
+ s: 'چند سيڪنڊ',
+ m: 'هڪ منٽ',
+ mm: '%d منٽ',
+ h: 'هڪ ڪلاڪ',
+ hh: '%d ڪلاڪ',
+ d: 'هڪ ڏينهن',
+ dd: '%d ڏينهن',
+ M: 'هڪ مهينو',
+ MM: '%d مهينا',
+ y: 'هڪ سال',
+ yy: '%d سال'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/se.js b/src/locale/se.js
index 99db63f6..9c453f1d 100644
--- a/src/locale/se.js
+++ b/src/locale/se.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),
monthsShort: 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'),
weekdaysMin: 's_v_m_g_d_b_L'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'MMMM D. [b.] YYYY',
+ LLL: 'MMMM D. [b.] YYYY [ti.] HH:mm',
+ LLLL: 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm'
+ },
+ relativeTime: {
+ future: '%s geažes',
+ past: 'maŋit %s',
+ s: 'moadde sekunddat',
+ m: 'okta minuhta',
+ mm: '%d minuhtat',
+ h: 'okta diimmu',
+ hh: '%d diimmut',
+ d: 'okta beaivi',
+ dd: '%d beaivvit',
+ M: 'okta mánnu',
+ MM: '%d mánut',
+ y: 'okta jahki',
+ yy: '%d jagit'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/si.js b/src/locale/si.js
index 192e9a10..1981031e 100644
--- a/src/locale/si.js
+++ b/src/locale/si.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'ඉරි_සඳු_අඟ_බදා_බ්රහ_සිකු_සෙන'.split('_'),
monthsShort: 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split('_'),
weekdaysMin: 'ඉ_ස_අ_බ_බ්ර_සි_සෙ'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'a h:mm',
+ LTS: 'a h:mm:ss',
+ L: 'YYYY/MM/DD',
+ LL: 'YYYY MMMM D',
+ LLL: 'YYYY MMMM D, a h:mm',
+ LLLL: 'YYYY MMMM D [වැනි] dddd, a h:mm:ss'
+ },
+ relativeTime: {
+ future: '%sකින්',
+ past: '%sකට පෙර',
+ s: 'තත්පර කිහිපය',
+ m: 'මිනිත්තුව',
+ mm: 'මිනිත්තු %d',
+ h: 'පැය',
+ hh: 'පැය %d',
+ d: 'දිනය',
+ dd: 'දින %d',
+ M: 'මාසය',
+ MM: 'මාස %d',
+ y: 'වසර',
+ yy: 'වසර %d'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/sk.js b/src/locale/sk.js
index 7f45b189..aa5b7bfa 100644
--- a/src/locale/sk.js
+++ b/src/locale/sk.js
@@ -20,9 +20,18 @@ const locale = {
y: 'rok',
yy: '%d rokov'
},
- ordinal: n => `${n}º`
+ ordinal: n => `${n}º`,
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd D. MMMM YYYY H:mm'
+ }
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/sl.js b/src/locale/sl.js
index c68552ad..d5cb073b 100644
--- a/src/locale/sl.js
+++ b/src/locale/sl.js
@@ -8,7 +8,15 @@ const locale = {
weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
monthsShort: 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),
weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd, D. MMMM YYYY H:mm'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/sq.js b/src/locale/sq.js
index ac881192..ef3f2a89 100644
--- a/src/locale/sq.js
+++ b/src/locale/sq.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),
monthsShort: 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),
weekdaysMin: 'D_H_Ma_Më_E_P_Sh'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'në %s',
+ past: '%s më parë',
+ s: 'disa sekonda',
+ m: 'një minutë',
+ mm: '%d minuta',
+ h: 'një orë',
+ hh: '%d orë',
+ d: 'një ditë',
+ dd: '%d ditë',
+ M: 'një muaj',
+ MM: '%d muaj',
+ y: 'një vit',
+ yy: '%d vite'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/sr-cyrl.js b/src/locale/sr-cyrl.js
index 82d3ecd8..40444f4c 100644
--- a/src/locale/sr-cyrl.js
+++ b/src/locale/sr-cyrl.js
@@ -20,9 +20,18 @@ const locale = {
y: 'година',
yy: '%d године'
},
- ordinal: n => `${n}.`
+ ordinal: n => `${n}.`,
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd, D. MMMM YYYY H:mm'
+ }
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/sr.js b/src/locale/sr.js
index b0140fa8..1ade8f03 100644
--- a/src/locale/sr.js
+++ b/src/locale/sr.js
@@ -20,9 +20,18 @@ const locale = {
y: 'godina',
yy: '%d godine'
},
- ordinal: n => `${n}.`
+ ordinal: n => `${n}.`,
+ formats: {
+ LT: 'H:mm',
+ LTS: 'H:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM YYYY',
+ LLL: 'D. MMMM YYYY H:mm',
+ LLLL: 'dddd, D. MMMM YYYY H:mm'
+ }
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/ss.js b/src/locale/ss.js
index 22a4ddac..2a564ede 100644
--- a/src/locale/ss.js
+++ b/src/locale/ss.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),
monthsShort: 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),
weekdaysMin: 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY h:mm A',
+ LLLL: 'dddd, D MMMM YYYY h:mm A'
+ },
+ relativeTime: {
+ future: 'nga %s',
+ past: 'wenteka nga %s',
+ s: 'emizuzwana lomcane',
+ m: 'umzuzu',
+ mm: '%d emizuzu',
+ h: 'lihora',
+ hh: '%d emahora',
+ d: 'lilanga',
+ dd: '%d emalanga',
+ M: 'inyanga',
+ MM: '%d tinyanga',
+ y: 'umnyaka',
+ yy: '%d iminyaka'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/sv.js b/src/locale/sv.js
index aa61d8f1..288c953d 100644
--- a/src/locale/sv.js
+++ b/src/locale/sv.js
@@ -43,3 +43,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/sw.js b/src/locale/sw.js
index 7e68f481..4b05ace9 100644
--- a/src/locale/sw.js
+++ b/src/locale/sw.js
@@ -37,3 +37,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/ta.js b/src/locale/ta.js
index 1c15e584..9498a73f 100644
--- a/src/locale/ta.js
+++ b/src/locale/ta.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'),
monthsShort: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'),
weekdaysMin: 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, HH:mm',
+ LLLL: 'dddd, D MMMM YYYY, HH:mm'
+ },
+ relativeTime: {
+ future: '%s இல்',
+ past: '%s முன்',
+ s: 'ஒரு சில விநாடிகள்',
+ m: 'ஒரு நிமிடம்',
+ mm: '%d நிமிடங்கள்',
+ h: 'ஒரு மணி நேரம்',
+ hh: '%d மணி நேரம்',
+ d: 'ஒரு நாள்',
+ dd: '%d நாட்கள்',
+ M: 'ஒரு மாதம்',
+ MM: '%d மாதங்கள்',
+ y: 'ஒரு வருடம்',
+ yy: '%d ஆண்டுகள்'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/te.js b/src/locale/te.js
index fd0bd6d9..b2970b5f 100644
--- a/src/locale/te.js
+++ b/src/locale/te.js
@@ -7,7 +7,30 @@ const locale = {
weekdaysShort: 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'),
monthsShort: 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split('_'),
weekdaysMin: 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'A h:mm',
+ LTS: 'A h:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY, A h:mm',
+ LLLL: 'dddd, D MMMM YYYY, A h:mm'
+ },
+ relativeTime: {
+ future: '%s లో',
+ past: '%s క్రితం',
+ s: 'కొన్ని క్షణాలు',
+ m: 'ఒక నిమిషం',
+ mm: '%d నిమిషాలు',
+ h: 'ఒక గంట',
+ hh: '%d గంటలు',
+ d: 'ఒక రోజు',
+ dd: '%d రోజులు',
+ M: 'ఒక నెల',
+ MM: '%d నెలలు',
+ y: 'ఒక సంవత్సరం',
+ yy: '%d సంవత్సరాలు'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/tet.js b/src/locale/tet.js
index aa152d6a..1ecb5329 100644
--- a/src/locale/tet.js
+++ b/src/locale/tet.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Dom_Seg_Ters_Kua_Kint_Sest_Sab'.split('_'),
monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
weekdaysMin: 'Do_Seg_Te_Ku_Ki_Ses_Sa'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'iha %s',
+ past: '%s liuba',
+ s: 'minutu balun',
+ m: 'minutu ida',
+ mm: 'minutu %d',
+ h: 'oras ida',
+ hh: 'oras %d',
+ d: 'loron ida',
+ dd: 'loron %d',
+ M: 'fulan ida',
+ MM: 'fulan %d',
+ y: 'tinan ida',
+ yy: 'tinan %d'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/tg.js b/src/locale/tg.js
index b2e0abbe..a789c344 100644
--- a/src/locale/tg.js
+++ b/src/locale/tg.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'яшб_дшб_сшб_чшб_пшб_ҷум_шнб'.split('_'),
monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
weekdaysMin: 'яш_дш_сш_чш_пш_ҷм_шб'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'баъди %s',
+ past: '%s пеш',
+ s: 'якчанд сония',
+ m: 'як дақиқа',
+ mm: '%d дақиқа',
+ h: 'як соат',
+ hh: '%d соат',
+ d: 'як рӯз',
+ dd: '%d рӯз',
+ M: 'як моҳ',
+ MM: '%d моҳ',
+ y: 'як сол',
+ yy: '%d сол'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/th.js b/src/locale/th.js
index 6b2ca448..e831e87d 100644
--- a/src/locale/th.js
+++ b/src/locale/th.js
@@ -36,3 +36,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/tl-ph.js b/src/locale/tl-ph.js
index 56611a7f..e8023845 100644
--- a/src/locale/tl-ph.js
+++ b/src/locale/tl-ph.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'MM/D/YYYY',
+ LL: 'MMMM D, YYYY',
+ LLL: 'MMMM D, YYYY HH:mm',
+ LLLL: 'dddd, MMMM DD, YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'sa loob ng %s',
+ past: '%s ang nakalipas',
+ s: 'ilang segundo',
+ m: 'isang minuto',
+ mm: '%d minuto',
+ h: 'isang oras',
+ hh: '%d oras',
+ d: 'isang araw',
+ dd: '%d araw',
+ M: 'isang buwan',
+ MM: '%d buwan',
+ y: 'isang taon',
+ yy: '%d taon'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/tlh.js b/src/locale/tlh.js
index 69ff95c7..c62eeccd 100644
--- a/src/locale/tlh.js
+++ b/src/locale/tlh.js
@@ -8,7 +8,15 @@ const locale = {
weekdaysShort: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
monthsShort: 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'),
weekdaysMin: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/tr.js b/src/locale/tr.js
index 29c825f5..ac8f0f20 100644
--- a/src/locale/tr.js
+++ b/src/locale/tr.js
@@ -34,3 +34,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/tzl.js b/src/locale/tzl.js
index 2c70fd67..5c6dc887 100644
--- a/src/locale/tzl.js
+++ b/src/locale/tzl.js
@@ -8,7 +8,15 @@ const locale = {
weekdaysShort: 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),
monthsShort: 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),
weekdaysMin: 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH.mm',
+ LTS: 'HH.mm.ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D. MMMM [dallas] YYYY',
+ LLL: 'D. MMMM [dallas] YYYY HH.mm',
+ LLLL: 'dddd, [li] D. MMMM [dallas] YYYY HH.mm'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/tzm-latn.js b/src/locale/tzm-latn.js
index df71adba..529e55b2 100644
--- a/src/locale/tzm-latn.js
+++ b/src/locale/tzm-latn.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
monthsShort: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
weekdaysMin: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'dadkh s yan %s',
+ past: 'yan %s',
+ s: 'imik',
+ m: 'minuḍ',
+ mm: '%d minuḍ',
+ h: 'saɛa',
+ hh: '%d tassaɛin',
+ d: 'ass',
+ dd: '%d ossan',
+ M: 'ayowr',
+ MM: '%d iyyirn',
+ y: 'asgas',
+ yy: '%d isgasn'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/tzm.js b/src/locale/tzm.js
index 4097e40a..5c75ea54 100644
--- a/src/locale/tzm.js
+++ b/src/locale/tzm.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
monthsShort: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'),
weekdaysMin: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',
+ past: 'ⵢⴰⵏ %s',
+ s: 'ⵉⵎⵉⴽ',
+ m: 'ⵎⵉⵏⵓⴺ',
+ mm: '%d ⵎⵉⵏⵓⴺ',
+ h: 'ⵙⴰⵄⴰ',
+ hh: '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',
+ d: 'ⴰⵙⵙ',
+ dd: '%d oⵙⵙⴰⵏ',
+ M: 'ⴰⵢoⵓⵔ',
+ MM: '%d ⵉⵢⵢⵉⵔⵏ',
+ y: 'ⴰⵙⴳⴰⵙ',
+ yy: '%d ⵉⵙⴳⴰⵙⵏ'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/ug-cn.js b/src/locale/ug-cn.js
index fc864804..405d4106 100644
--- a/src/locale/ug-cn.js
+++ b/src/locale/ug-cn.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
monthsShort: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split('_'),
weekdaysMin: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'YYYY-MM-DD',
+ LL: 'YYYY-يىلىM-ئاينىڭD-كۈنى',
+ LLL: 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',
+ LLLL: 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm'
+ },
+ relativeTime: {
+ future: '%s كېيىن',
+ past: '%s بۇرۇن',
+ s: 'نەچچە سېكونت',
+ m: 'بىر مىنۇت',
+ mm: '%d مىنۇت',
+ h: 'بىر سائەت',
+ hh: '%d سائەت',
+ d: 'بىر كۈن',
+ dd: '%d كۈن',
+ M: 'بىر ئاي',
+ MM: '%d ئاي',
+ y: 'بىر يىل',
+ yy: '%d يىل'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/uk.js b/src/locale/uk.js
index 81e51f83..3cd82af0 100644
--- a/src/locale/uk.js
+++ b/src/locale/uk.js
@@ -23,9 +23,18 @@ const locale = {
y: 'рік',
yy: '%d роки'
},
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD.MM.YYYY',
+ LL: 'D MMMM YYYY р.',
+ LLL: 'D MMMM YYYY р., HH:mm',
+ LLLL: 'dddd, D MMMM YYYY р., HH:mm'
+ }
}
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/ur.js b/src/locale/ur.js
index 09e909f1..c4a5e52f 100644
--- a/src/locale/ur.js
+++ b/src/locale/ur.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ'.split('_'),
monthsShort: 'جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر'.split('_'),
weekdaysMin: 'اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd، D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: '%s بعد',
+ past: '%s قبل',
+ s: 'چند سیکنڈ',
+ m: 'ایک منٹ',
+ mm: '%d منٹ',
+ h: 'ایک گھنٹہ',
+ hh: '%d گھنٹے',
+ d: 'ایک دن',
+ dd: '%d دن',
+ M: 'ایک ماہ',
+ MM: '%d ماہ',
+ y: 'ایک سال',
+ yy: '%d سال'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/uz-latn.js b/src/locale/uz-latn.js
index fbe2a9d4..6adaf96f 100644
--- a/src/locale/uz-latn.js
+++ b/src/locale/uz-latn.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'),
monthsShort: 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'),
weekdaysMin: 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'D MMMM YYYY, dddd HH:mm'
+ },
+ relativeTime: {
+ future: 'Yaqin %s ichida',
+ past: 'Bir necha %s oldin',
+ s: 'soniya',
+ m: 'bir daqiqa',
+ mm: '%d daqiqa',
+ h: 'bir soat',
+ hh: '%d soat',
+ d: 'bir kun',
+ dd: '%d kun',
+ M: 'bir oy',
+ MM: '%d oy',
+ y: 'bir yil',
+ yy: '%d yil'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/uz.js b/src/locale/uz.js
index 7591d7f2..2f6327c4 100644
--- a/src/locale/uz.js
+++ b/src/locale/uz.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),
monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
weekdaysMin: 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'D MMMM YYYY, dddd HH:mm'
+ },
+ relativeTime: {
+ future: 'Якин %s ичида',
+ past: 'Бир неча %s олдин',
+ s: 'фурсат',
+ m: 'бир дакика',
+ mm: '%d дакика',
+ h: 'бир соат',
+ hh: '%d соат',
+ d: 'бир кун',
+ dd: '%d кун',
+ M: 'бир ой',
+ MM: '%d ой',
+ y: 'бир йил',
+ yy: '%d йил'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/vi.js b/src/locale/vi.js
index 055e4593..8b915aac 100644
--- a/src/locale/vi.js
+++ b/src/locale/vi.js
@@ -8,7 +8,34 @@ const locale = {
weekdaysShort: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
monthsShort: 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),
weekdaysMin: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM [năm] YYYY',
+ LLL: 'D MMMM [năm] YYYY HH:mm',
+ LLLL: 'dddd, D MMMM [năm] YYYY HH:mm',
+ l: 'DD/M/YYYY',
+ ll: 'D MMM YYYY',
+ lll: 'D MMM YYYY HH:mm',
+ llll: 'ddd, D MMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: '%s tới',
+ past: '%s trước',
+ s: 'vài giây',
+ m: 'một phút',
+ mm: '%d phút',
+ h: 'một giờ',
+ hh: '%d giờ',
+ d: 'một ngày',
+ dd: '%d ngày',
+ M: 'một tháng',
+ MM: '%d tháng',
+ y: 'một năm',
+ yy: '%d năm'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/x-pseudo.js b/src/locale/x-pseudo.js
index 692c0257..7cc06374 100644
--- a/src/locale/x-pseudo.js
+++ b/src/locale/x-pseudo.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'),
monthsShort: 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split('_'),
weekdaysMin: 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'HH:mm',
+ LTS: 'HH:mm:ss',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY HH:mm',
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
+ },
+ relativeTime: {
+ future: 'í~ñ %s',
+ past: '%s á~gó',
+ s: 'á ~féw ~sécó~ñds',
+ m: 'á ~míñ~úté',
+ mm: '%d m~íñú~tés',
+ h: 'á~ñ hó~úr',
+ hh: '%d h~óúrs',
+ d: 'á ~dáý',
+ dd: '%d d~áýs',
+ M: 'á ~móñ~th',
+ MM: '%d m~óñt~hs',
+ y: 'á ~ýéár',
+ yy: '%d ý~éárs'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/yo.js b/src/locale/yo.js
index c9cf21ac..c1884a28 100644
--- a/src/locale/yo.js
+++ b/src/locale/yo.js
@@ -8,7 +8,30 @@ const locale = {
weekdaysShort: 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'),
monthsShort: 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'),
weekdaysMin: 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'),
- ordinal: n => n
+ ordinal: n => n,
+ formats: {
+ LT: 'h:mm A',
+ LTS: 'h:mm:ss A',
+ L: 'DD/MM/YYYY',
+ LL: 'D MMMM YYYY',
+ LLL: 'D MMMM YYYY h:mm A',
+ LLLL: 'dddd, D MMMM YYYY h:mm A'
+ },
+ relativeTime: {
+ future: 'ní %s',
+ past: '%s kọjá',
+ s: 'ìsẹjú aayá die',
+ m: 'ìsẹjú kan',
+ mm: 'ìsẹjú %d',
+ h: 'wákati kan',
+ hh: 'wákati %d',
+ d: 'ọjọ́ kan',
+ dd: 'ọjọ́ %d',
+ M: 'osù kan',
+ MM: 'osù %d',
+ y: 'ọdún kan',
+ yy: 'ọdún %d'
+ }
}
dayjs.locale(locale, null, true)
diff --git a/src/locale/zh-cn.js b/src/locale/zh-cn.js
index 73694425..23f82e26 100644
--- a/src/locale/zh-cn.js
+++ b/src/locale/zh-cn.js
@@ -48,3 +48,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/zh-hk.js b/src/locale/zh-hk.js
index bd615155..042d8886 100644
--- a/src/locale/zh-hk.js
+++ b/src/locale/zh-hk.js
@@ -36,3 +36,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/locale/zh-tw.js b/src/locale/zh-tw.js
index 572b86c2..f931c0a5 100644
--- a/src/locale/zh-tw.js
+++ b/src/locale/zh-tw.js
@@ -40,3 +40,4 @@ const locale = {
dayjs.locale(locale, null, true)
export default locale
+
diff --git a/src/plugin/advancedFormat/index.js b/src/plugin/advancedFormat/index.js
index 1b5288c0..117831b8 100644
--- a/src/plugin/advancedFormat/index.js
+++ b/src/plugin/advancedFormat/index.js
@@ -13,7 +13,7 @@ export default (o, c, d) => { // locale needed later
const locale = this.$locale()
const utils = this.$utils()
const str = formatStr || FORMAT_DEFAULT
- const result = str.replace(/Q|wo|gggg|Do|X|x|k{1,2}|S/g, (match) => {
+ const result = str.replace(/\[([^\]]+)]|Q|wo|gggg|Do|X|x|k{1,2}|S/g, (match) => {
switch (match) {
case 'Q':
return Math.ceil((this.$M + 1) / 3)
@@ -28,8 +28,10 @@ export default (o, c, d) => { // locale needed later
return utils.s(String(this.$H === 0 ? 24 : this.$H), match === 'k' ? 1 : 2, '0')
case 'X':
return Math.floor(this.$d.getTime() / 1000)
- default: // 'x'
+ case 'x':
return this.$d.getTime()
+ default:
+ return match
}
})
return oldFormat.bind(this)(result)
diff --git a/src/plugin/buddhistEra/index.js b/src/plugin/buddhistEra/index.js
index 3ee0dd52..ff048143 100644
--- a/src/plugin/buddhistEra/index.js
+++ b/src/plugin/buddhistEra/index.js
@@ -7,10 +7,10 @@ export default (o, c) => { // locale needed later
proto.format = function (formatStr) {
const yearBias = 543
const str = formatStr || FORMAT_DEFAULT
- const result = str.replace(/BBBB|BB/g, (match) => {
+ const result = str.replace(/(\[[^\]]+])|BBBB|BB/g, (match, a) => {
const year = String(this.$y + yearBias)
const args = match === 'BB' ? [year.slice(-2), 2] : [year, 4]
- return this.$utils().s(...args, '0')
+ return a || this.$utils().s(...args, '0')
})
return oldFormat.bind(this)(result)
}
diff --git a/src/plugin/customParseFormat/index.js b/src/plugin/customParseFormat/index.js
index 6386650c..08f67708 100644
--- a/src/plugin/customParseFormat/index.js
+++ b/src/plugin/customParseFormat/index.js
@@ -137,7 +137,7 @@ function makeParser(format) {
const match = regex.exec(part)
const value = match[0]
parser.call(time, value)
- start += value.length
+ input = input.replace(value, '')
}
}
correctHours(time)
diff --git a/src/plugin/localizedFormat/index.js b/src/plugin/localizedFormat/index.js
index e3412dcf..b72e635b 100644
--- a/src/plugin/localizedFormat/index.js
+++ b/src/plugin/localizedFormat/index.js
@@ -9,19 +9,16 @@ export default (o, c, d) => {
L: 'MM/DD/YYYY',
LL: 'MMMM D, YYYY',
LLL: 'MMMM D, YYYY h:mm A',
- LLLL: 'dddd, MMMM D, YYYY h:mm A',
- l: 'M/D/YYYY',
- ll: 'MMM D, YYYY',
- lll: 'MMM D, YYYY h:mm A',
- llll: 'ddd, MMM D, YYYY h:mm A'
+ LLLL: 'dddd, MMMM D, YYYY h:mm A'
}
d.en.formats = englishFormats
- proto.format = function (formatStr) {
- const locale = this.$locale()
- const formats = locale.formats || {}
- const str = formatStr || FORMAT_DEFAULT
- const result = str.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (_, a, b) =>
- a || formats[b] || englishFormats[b])
+ const t = format => format.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (_, a, b) => a || b.slice(1))
+ proto.format = function (formatStr = FORMAT_DEFAULT) {
+ const { formats = {} } = this.$locale()
+ const result = formatStr.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (_, a, b) => {
+ const B = b && b.toUpperCase()
+ return a || formats[b] || englishFormats[b] || t(formats[B])
+ })
return oldFormat.call(this, result)
}
}
diff --git a/src/plugin/relativeTime/index.js b/src/plugin/relativeTime/index.js
index 1ac51e43..6720d759 100644
--- a/src/plugin/relativeTime/index.js
+++ b/src/plugin/relativeTime/index.js
@@ -37,14 +37,15 @@ export default (o, c, d) => {
let out
for (let i = 0; i < Tl; i += 1) {
- const t = T[i]
+ let t = T[i]
if (t.d) {
result = isFrom
? d(input).diff(instance, t.d, true)
: instance.diff(input, t.d, true)
}
- const abs = Math.ceil(Math.abs(result))
+ const abs = Math.round(Math.abs(result))
if (abs <= t.r || !t.r) {
+ if (abs === 1) t = T[i - 1] // 1 minutes -> a minute
out = loc[t.l].replace('%d', abs)
break
}
diff --git a/src/plugin/weekday/index.js b/src/plugin/weekday/index.js
new file mode 100644
index 00000000..c3c86ef9
--- /dev/null
+++ b/src/plugin/weekday/index.js
@@ -0,0 +1,13 @@
+export default (o, c) => {
+ const proto = c.prototype
+ proto.weekday = function (input) {
+ const weekStart = this.$locale().weekStart || 0
+ const { $W } = this
+ const weekday = ($W < weekStart ? $W + 7 : $W) - weekStart
+ if (this.$utils().u(input)) {
+ return weekday
+ }
+ return this.subtract(weekday, 'day').add(input, 'day')
+ }
+}
+
diff --git a/test/display.test.js b/test/display.test.js
index 1f897758..764a5d0e 100644
--- a/test/display.test.js
+++ b/test/display.test.js
@@ -2,6 +2,7 @@ import moment from 'moment'
import MockDate from 'mockdate'
import dayjs from '../src'
import th from '../src/locale/th'
+import '../src/locale/ja'
beforeEach(() => {
MockDate.set(new Date())
@@ -77,12 +78,18 @@ it('Format meridiens a A am / pm', () => {
expect(dayjs(time).format('a')).toBe(moment(time).format('a'))
expect(dayjs(time).format('A')).toBe('AM')
expect(dayjs(time).format('A')).toBe(moment(time).format('A'))
+ expect(dayjs(time).locale('ja').format('a')).toBe('午前')
+ expect(dayjs(time).locale('ja').format('a'))
+ .toBe(moment(time).locale('ja').format('a'))
const time2 = '2018-05-02T23:00:00.000'
expect(dayjs(time2).format('a')).toBe('pm')
expect(dayjs(time2).format('a')).toBe(moment(time2).format('a'))
expect(dayjs(time2).format('A')).toBe('PM')
expect(dayjs(time2).format('A')).toBe(moment(time2).format('A'))
+ expect(dayjs(time2).locale('ja').format('a')).toBe('午後')
+ expect(dayjs(time2).locale('ja').format('a'))
+ .toBe(moment(time2).locale('ja').format('a'))
})
it('Format Minute m mm', () => {
diff --git a/test/locale/keys.test.js b/test/locale/keys.test.js
index 71027d20..a06960a3 100644
--- a/test/locale/keys.test.js
+++ b/test/locale/keys.test.js
@@ -15,8 +15,8 @@ fs.readdirSync(path.join(__dirname, localeDir))
})
})
-it('Locale keys', () => {
- Locale.forEach((locale) => {
+Locale.forEach((locale) => {
+ it(`Locale keys for ${locale.content.name}`, () => {
const {
name,
ordinal,
@@ -27,18 +27,31 @@ it('Locale keys', () => {
weekdaysShort,
monthsShort,
weekdaysMin,
- weekStart
+ weekStart,
+ meridiem
} = locale.content
expect(name).toEqual(locale.name.replace('.js', ''))
expect(weekdays).toEqual(expect.any(Array))
if (weekdaysShort) expect(weekdaysShort).toEqual(expect.any(Array))
- if (monthsShort) expect(monthsShort).toEqual(expect.any(Array))
if (weekdaysMin) expect(weekdaysMin).toEqual(expect.any(Array))
if (weekStart) expect(weekStart).toEqual(expect.any(Number))
- expect(months).toEqual(expect.any(Array))
+ // months could be a function or array
+ if (Array.isArray(months)) {
+ expect(months).toEqual(expect.any(Array))
+ } else {
+ expect(months(dayjs(), 'str')).toEqual(expect.any(String))
+ }
+ // monthsShort could be a function or array
+ if (monthsShort) {
+ if (Array.isArray(monthsShort)) {
+ expect(monthsShort).toEqual(expect.any(Array))
+ } else {
+ expect(monthsShort(dayjs(), 'str')).toEqual(expect.any(String))
+ }
+ }
// function pass date return string or number or null
if (name !== 'en') { // en ordinal set in advancedFormat
for (let i = 1; i <= 31; i += 1) {
@@ -80,5 +93,11 @@ it('Locale keys', () => {
'past', 's', 'y', 'yy']
.sort())
}
+
+ if (meridiem) {
+ for (let i = 1; i <= 23; i += 1) {
+ expect(meridiem(i)).toEqual(expect.anything())
+ }
+ }
})
})
diff --git a/test/locale/ru.test.js b/test/locale/ru.test.js
new file mode 100644
index 00000000..3960c78d
--- /dev/null
+++ b/test/locale/ru.test.js
@@ -0,0 +1,25 @@
+import moment from 'moment'
+import MockDate from 'mockdate'
+import dayjs from '../../src'
+import '../../src/locale/ru'
+
+beforeEach(() => {
+ MockDate.set(new Date())
+})
+
+afterEach(() => {
+ MockDate.reset()
+})
+
+it('Format Month with locale function', () => {
+ for (let i = 0; i <= 7; i += 1) {
+ const dayjsRU = dayjs().locale('ru').add(i, 'day')
+ const momentRU = moment().locale('ru').add(i, 'day')
+ const testFormat1 = 'DD MMMM YYYY MMM'
+ const testFormat2 = 'MMMM'
+ const testFormat3 = 'MMM'
+ expect(dayjsRU.format(testFormat1)).toEqual(momentRU.format(testFormat1))
+ expect(dayjsRU.format(testFormat2)).toEqual(momentRU.format(testFormat2))
+ expect(dayjsRU.format(testFormat3)).toEqual(momentRU.format(testFormat3))
+ }
+})
diff --git a/test/manipulate.test.js b/test/manipulate.test.js
index eb83f5d9..5fe28cb4 100644
--- a/test/manipulate.test.js
+++ b/test/manipulate.test.js
@@ -64,6 +64,13 @@ it('Add Time days', () => {
expect(dayjs().add('2', 'years').valueOf()).toBe(moment().add('2', 'years').valueOf())
})
+it('Add Time with decimal', () => {
+ expect(dayjs().add(0.4, 'day').valueOf()).toBe(moment().add(0.4, 'day').valueOf())
+ expect(dayjs().add(0.5, 'day').valueOf()).toBe(moment().add(0.5, 'day').valueOf())
+ expect(dayjs().add(0.4, 'week').valueOf()).toBe(moment().add(0.4, 'week').valueOf())
+ expect(dayjs().add(0.5, 'week').valueOf()).toBe(moment().add(0.5, 'week').valueOf())
+})
+
it('Subtract Time days', () => {
expect(dayjs().subtract(1, 'days').valueOf()).toBe(moment().subtract(1, 'days').valueOf())
})
diff --git a/test/plugin/advancedFormat.test.js b/test/plugin/advancedFormat.test.js
index 74de4eb9..e3ccaddc 100644
--- a/test/plugin/advancedFormat.test.js
+++ b/test/plugin/advancedFormat.test.js
@@ -82,3 +82,14 @@ it('Format Week Year gggg', () => {
const d = '2018-12-31'
expect(dayjs(d).format('gggg')).toBe(moment(d).format('gggg'))
})
+
+it('Skips format strings inside brackets', () => {
+ expect(dayjs().format('[Q]')).toBe('Q')
+ expect(dayjs().format('[Do]')).toBe('Do')
+ expect(dayjs().format('[gggg]')).toBe('gggg')
+ expect(dayjs().format('[wo]')).toBe('wo')
+ expect(dayjs().format('[k]')).toBe('k')
+ expect(dayjs().format('[kk]')).toBe('kk')
+ expect(dayjs().format('[X]')).toBe('X')
+ expect(dayjs().format('[x]')).toBe('x')
+})
diff --git a/test/plugin/buddhistEra.test.js b/test/plugin/buddhistEra.test.js
index 2482702f..626df54c 100644
--- a/test/plugin/buddhistEra.test.js
+++ b/test/plugin/buddhistEra.test.js
@@ -31,3 +31,8 @@ it('Format Buddhist Era 4 digit with other format', () => {
const momentDate = today.format(format).replace('BBBB', today.year() + 543)
expect(dayjs().format(format)).toBe(momentDate)
})
+
+it('Skips format strings inside brackets', () => {
+ expect(dayjs().format('[BBBB]')).toBe('BBBB')
+ expect(dayjs().format('[BB]')).toBe('BB')
+})
diff --git a/test/plugin/customParseFormat.test.js b/test/plugin/customParseFormat.test.js
index 49462f43..8f7dc3ba 100644
--- a/test/plugin/customParseFormat.test.js
+++ b/test/plugin/customParseFormat.test.js
@@ -161,6 +161,15 @@ it('return Invalid Date when parse corrupt short string', () => {
expect(dayjs(input, format).format()).toBe('Invalid Date')
})
+it('Invalid Dates', () => {
+ expect(dayjs('10/12/2014', 'YYYY-MM-DD').format('MM-DD-YYYY')).toBe('Invalid Date')
+ expect(dayjs('10-12-2014', 'YYYY-MM-DD').format('MM-DD-YYYY')).toBe('Invalid Date')
+})
+
+it('Valid Date', () => {
+ expect(dayjs('2014/10/12', 'YYYY-MM-DD').format('MM-DD-YYYY')).toBe('10-12-2014')
+})
+
it('correctly parse month from string after changing locale globally', () => {
const input = '2018 лютий 03'
const format = 'YYYY MMMM DD'
diff --git a/test/plugin/localizableFormat.test.js b/test/plugin/localizedFormat.test.js
similarity index 56%
rename from test/plugin/localizableFormat.test.js
rename to test/plugin/localizedFormat.test.js
index dc634812..1c7a89e1 100644
--- a/test/plugin/localizableFormat.test.js
+++ b/test/plugin/localizedFormat.test.js
@@ -2,7 +2,7 @@ import MockDate from 'mockdate'
import moment from 'moment'
import dayjs from '../../src'
import es from '../../src/locale/es'
-import ar from '../../src/locale/ar'
+import znCn from '../../src/locale/zh-cn'
import localizedFormat from '../../src/plugin/localizedFormat'
dayjs.extend(localizedFormat)
@@ -18,7 +18,7 @@ afterEach(() => {
it('Declares English localized formats', () => {
expect(dayjs.en).toBeDefined()
expect(dayjs.en.formats).toBeDefined();
- ['LT', 'LTS', 'L', 'LL', 'LLL', 'LLLL', 'l', 'll', 'lll', 'llll'].forEach(option =>
+ ['LT', 'LTS', 'L', 'LL', 'LLL', 'LLLL'].forEach(option =>
expect(dayjs.en.formats[option]).toBeDefined())
})
@@ -31,12 +31,27 @@ it('Should not interpolate characters inside square brackets', () => {
expect(actualDate.format('YYYY [l] YYYY')).toBe('1970 l 1970')
expect(actualDate.format('l [l] l')).toBe('1/1/1970 l 1/1/1970')
expect(actualDate.format('[L LL LLL LLLL]')).toBe(expectedDate.format('[L LL LLL LLLL]'))
+
+
+ const localeFormats = {
+ L: '[MMMM MM DD dddd]'
+ }
+ const mockedDayJsLocale = {
+ ...es,
+ name: 'fake-locale',
+ formats: {
+ ...localeFormats
+ }
+ }
+ const fakeDate = dayjs(date, { locale: mockedDayJsLocale })
+
+ expect(fakeDate.locale('fake-locale').format('l')).toEqual('MMMM MM DD dddd')
})
it('Recognizes localized format options', () => {
const { formats } = dayjs.en
const date = dayjs();
- ['LT', 'LTS', 'L', 'LL', 'LLL', 'LLLL', 'l', 'll', 'lll', 'llll'].forEach(option =>
+ ['LT', 'LTS', 'L', 'LL', 'LLL', 'LLLL'].forEach(option =>
expect(date.format(option)).toBe(date.format(formats[option])))
})
@@ -44,7 +59,7 @@ it('Uses correct English formats', () => {
const date = new Date()
const actualDate = dayjs(date)
const expectedDate = moment(date);
- ['LT', 'LTS', 'L', 'LL', 'LLL', 'LLLL', 'l', 'll', 'lll', 'llll'].forEach(option =>
+ ['LT', 'LTS', 'L', 'LL', 'LLL', 'LLLL'].forEach(option =>
expect(actualDate.format(option)).toBe(expectedDate.format(option)))
})
@@ -52,8 +67,12 @@ it('Uses English formats in other locales as default', () => {
const date = new Date()
const actualDate = dayjs(date)
const expectedDate = moment(date)
- // todo: ar here isn't a good fix here
- expect(actualDate.locale(ar).format('L')).toBe(expectedDate.format('L'))
+ const mockLocale = {
+ name: 'mock',
+ weekdays: Array(7).fill(' '),
+ months: Array(12).fill(' ')
+ }
+ expect(actualDate.locale(mockLocale).format('L')).toBe(expectedDate.format('L'))
})
it('Leaves the default format intact', () => {
@@ -69,3 +88,21 @@ it('Uses the locale of the dayjs instance', () => {
const spanishDate = dayjs(date, { locale: es })
expect(englishDate.format('L LTS')).not.toBe(spanishDate.format('L LTS'))
})
+
+
+it('Uses the localized lowercase formats if defined', () => {
+ const date = new Date()
+ const znDate = dayjs(date, { locale: znCn });
+ ['l', 'll', 'lll', 'llll'].forEach(option => expect(znDate.format(option)).toBe(znDate.format(znCn.formats[option])))
+})
+
+it('Uses the localized uppercase formats as a base for lowercase formats, if not defined', () => {
+ const date = new Date()
+ const spanishDate = dayjs(date, { locale: es });
+
+ ['l', 'll', 'lll', 'llll'].forEach((option) => {
+ const upperCaseFormat = es.formats[option.toUpperCase()]
+ const adaptedFormat = upperCaseFormat.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (_, a, b) => a || b.slice(1))
+ expect(spanishDate.format(option)).toBe(spanishDate.format(adaptedFormat))
+ })
+})
diff --git a/test/plugin/relativeTime.test.js b/test/plugin/relativeTime.test.js
index 2bc4a896..fcf65ce4 100644
--- a/test/plugin/relativeTime.test.js
+++ b/test/plugin/relativeTime.test.js
@@ -17,16 +17,28 @@ it('Time from X', () => {
const T = [
[0, 'second'], // a few seconds
[44, 'second'], // a few seconds
+ [44.4, 'second'], // a few seconds
+ [44.5, 'second'], // a minute
[45, 'second'], // a minute
[89, 'second'], // a minute
+ [89.4, 'second'], // a minute
+ [89.5, 'second'], // a minute
[90, 'second'], // 2 minutes
[44, 'minute'], // 44 minutes
+ [44.4, 'minute'],
+ [44.5, 'minute'],
[45, 'minute'], // an hour
[89, 'minute'], // an hour
+ [89.4, 'minute'],
+ [89.5, 'minute'],
[90, 'minute'], // 2 hours
[21, 'hour'], // 21 hours
+ [21.4, 'hour'],
+ [21.5, 'hour'],
[22, 'hour'], // a day
[35, 'hour'], // a day
+ [35.4, 'hour'],
+ [35.5, 'hour'],
[36, 'hour'], // 2 days
[25, 'day'], // 25 days
[26, 'day'], // a month
diff --git a/test/plugin/weekday.test.js b/test/plugin/weekday.test.js
new file mode 100644
index 00000000..703f3ec8
--- /dev/null
+++ b/test/plugin/weekday.test.js
@@ -0,0 +1,43 @@
+import MockDate from 'mockdate'
+import moment from 'moment'
+import dayjs from '../../src'
+import weekday from '../../src/plugin/weekday'
+import '../../src/locale/zh-cn'
+import '../../src/locale/ar'
+
+dayjs.extend(weekday)
+
+beforeEach(() => {
+ MockDate.set(new Date())
+})
+
+afterEach(() => {
+ MockDate.reset()
+ moment.locale('en')
+ dayjs.locale('en')
+})
+
+it('Sunday is the first day of the week', () => {
+ expect(dayjs().weekday()).toBe(moment().weekday())
+ expect(dayjs().weekday(0).date()).toBe(moment().weekday(0).date())
+ expect(dayjs().weekday(-7).format()).toBe(moment().weekday(-7).format())
+ expect(dayjs().weekday(7).format()).toBe(moment().weekday(7).format())
+})
+
+it('Monday is the first day of the week', () => {
+ moment.locale('zh-cn')
+ dayjs.locale('zh-cn')
+ expect(dayjs().weekday()).toBe(moment().weekday())
+ expect(dayjs().weekday(0).date()).toBe(moment().weekday(0).date())
+ expect(dayjs().weekday(-7).format()).toBe(moment().weekday(-7).format())
+ expect(dayjs().weekday(7).format()).toBe(moment().weekday(7).format())
+})
+
+it('Saturday is the first day of the week', () => {
+ moment.locale('ar')
+ dayjs.locale('ar')
+ expect(dayjs().weekday()).toBe(moment().weekday())
+ expect(dayjs().weekday(0).date()).toBe(moment().weekday(0).date())
+ expect(dayjs().weekday(-7).valueOf()).toBe(moment().weekday(-7).valueOf())
+ expect(dayjs().weekday(7).valueOf()).toBe(moment().weekday(7).valueOf())
+})
diff --git a/types/index.d.ts b/types/index.d.ts
index 6473865c..b2864e01 100644
--- a/types/index.d.ts
+++ b/types/index.d.ts
@@ -65,7 +65,7 @@ declare namespace dayjs {
format(template?: string): string
- diff(date: ConfigType, unit: QUnitType, float?: boolean): number
+ diff(date: ConfigType, unit: QUnitType | OpUnitType, float?: boolean): number
valueOf(): number
diff --git a/types/plugin/weekday.d.ts b/types/plugin/weekday.d.ts
new file mode 100644
index 00000000..87a8025a
--- /dev/null
+++ b/types/plugin/weekday.d.ts
@@ -0,0 +1,12 @@
+import { PluginFunc } from 'dayjs'
+
+declare const plugin: PluginFunc
+export = plugin
+
+declare module 'dayjs' {
+ interface Dayjs {
+ weekday(): number
+
+ weekday(value: number): Dayjs
+ }
+}