forked from iamkun/dayjs
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update locale ar-* meridiem function (iamkun#1954)
- Loading branch information
1 parent
36662dc
commit 3d31611
Showing
14 changed files
with
168 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import MockDate from 'mockdate' | ||
import dayjs from '../../src' | ||
import relativeTime from '../../src/plugin/relativeTime' | ||
import '../../src/locale/ru' | ||
import locale from '../../src/locale/ar-dz' | ||
|
||
dayjs.extend(relativeTime) | ||
|
||
beforeEach(() => { | ||
MockDate.set(new Date()) | ||
}) | ||
|
||
afterEach(() => { | ||
MockDate.reset() | ||
}) | ||
|
||
it('Meridiem', () => { | ||
dayjs.locale(locale) | ||
expect(dayjs('2020-01-01 03:00:00').locale('ar-dz').format('A')).toEqual('ص') | ||
expect(dayjs('2020-01-01 11:00:00').locale('ar-dz').format('A')).toEqual('ص') | ||
expect(dayjs('2020-01-01 16:00:00').locale('ar-dz').format('A')).toEqual('م') | ||
expect(dayjs('2020-01-01 20:00:00').locale('ar-dz').format('A')).toEqual('م') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import MockDate from 'mockdate' | ||
import dayjs from '../../src' | ||
import relativeTime from '../../src/plugin/relativeTime' | ||
import '../../src/locale/ru' | ||
import locale from '../../src/locale/ar-iq' | ||
|
||
dayjs.extend(relativeTime) | ||
|
||
beforeEach(() => { | ||
MockDate.set(new Date()) | ||
}) | ||
|
||
afterEach(() => { | ||
MockDate.reset() | ||
}) | ||
|
||
it('Meridiem', () => { | ||
dayjs.locale(locale) | ||
expect(dayjs('2020-01-01 03:00:00').locale('ar-iq').format('A')).toEqual('ص') | ||
expect(dayjs('2020-01-01 11:00:00').locale('ar-iq').format('A')).toEqual('ص') | ||
expect(dayjs('2020-01-01 16:00:00').locale('ar-iq').format('A')).toEqual('م') | ||
expect(dayjs('2020-01-01 20:00:00').locale('ar-iq').format('A')).toEqual('م') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import MockDate from 'mockdate' | ||
import dayjs from '../../src' | ||
import relativeTime from '../../src/plugin/relativeTime' | ||
import '../../src/locale/ru' | ||
import locale from '../../src/locale/ar-kw' | ||
|
||
dayjs.extend(relativeTime) | ||
|
||
beforeEach(() => { | ||
MockDate.set(new Date()) | ||
}) | ||
|
||
afterEach(() => { | ||
MockDate.reset() | ||
}) | ||
|
||
it('Meridiem', () => { | ||
dayjs.locale(locale) | ||
expect(dayjs('2020-01-01 03:00:00').locale('ar-kw').format('A')).toEqual('ص') | ||
expect(dayjs('2020-01-01 11:00:00').locale('ar-kw').format('A')).toEqual('ص') | ||
expect(dayjs('2020-01-01 16:00:00').locale('ar-kw').format('A')).toEqual('م') | ||
expect(dayjs('2020-01-01 20:00:00').locale('ar-kw').format('A')).toEqual('م') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import MockDate from 'mockdate' | ||
import dayjs from '../../src' | ||
import relativeTime from '../../src/plugin/relativeTime' | ||
import '../../src/locale/ru' | ||
import locale from '../../src/locale/ar-ly' | ||
|
||
dayjs.extend(relativeTime) | ||
|
||
beforeEach(() => { | ||
MockDate.set(new Date()) | ||
}) | ||
|
||
afterEach(() => { | ||
MockDate.reset() | ||
}) | ||
|
||
it('Meridiem', () => { | ||
dayjs.locale(locale) | ||
expect(dayjs('2020-01-01 03:00:00').locale('ar-ly').format('A')).toEqual('ص') | ||
expect(dayjs('2020-01-01 11:00:00').locale('ar-ly').format('A')).toEqual('ص') | ||
expect(dayjs('2020-01-01 16:00:00').locale('ar-ly').format('A')).toEqual('م') | ||
expect(dayjs('2020-01-01 20:00:00').locale('ar-ly').format('A')).toEqual('م') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import MockDate from 'mockdate' | ||
import dayjs from '../../src' | ||
import relativeTime from '../../src/plugin/relativeTime' | ||
import '../../src/locale/ru' | ||
import locale from '../../src/locale/ar-ma' | ||
|
||
dayjs.extend(relativeTime) | ||
|
||
beforeEach(() => { | ||
MockDate.set(new Date()) | ||
}) | ||
|
||
afterEach(() => { | ||
MockDate.reset() | ||
}) | ||
|
||
it('Meridiem', () => { | ||
dayjs.locale(locale) | ||
expect(dayjs('2020-01-01 03:00:00').locale('ar-ma').format('A')).toEqual('ص') | ||
expect(dayjs('2020-01-01 11:00:00').locale('ar-ma').format('A')).toEqual('ص') | ||
expect(dayjs('2020-01-01 16:00:00').locale('ar-ma').format('A')).toEqual('م') | ||
expect(dayjs('2020-01-01 20:00:00').locale('ar-ma').format('A')).toEqual('م') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import MockDate from 'mockdate' | ||
import dayjs from '../../src' | ||
import relativeTime from '../../src/plugin/relativeTime' | ||
import '../../src/locale/ru' | ||
import locale from '../../src/locale/ar-sa' | ||
|
||
dayjs.extend(relativeTime) | ||
|
||
beforeEach(() => { | ||
MockDate.set(new Date()) | ||
}) | ||
|
||
afterEach(() => { | ||
MockDate.reset() | ||
}) | ||
|
||
it('Meridiem', () => { | ||
dayjs.locale(locale) | ||
expect(dayjs('2020-01-01 03:00:00').locale('ar-sa').format('A')).toEqual('ص') | ||
expect(dayjs('2020-01-01 11:00:00').locale('ar-sa').format('A')).toEqual('ص') | ||
expect(dayjs('2020-01-01 16:00:00').locale('ar-sa').format('A')).toEqual('م') | ||
expect(dayjs('2020-01-01 20:00:00').locale('ar-sa').format('A')).toEqual('م') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import MockDate from 'mockdate' | ||
import dayjs from '../../src' | ||
import relativeTime from '../../src/plugin/relativeTime' | ||
import '../../src/locale/ru' | ||
import locale from '../../src/locale/ar-tn' | ||
|
||
dayjs.extend(relativeTime) | ||
|
||
beforeEach(() => { | ||
MockDate.set(new Date()) | ||
}) | ||
|
||
afterEach(() => { | ||
MockDate.reset() | ||
}) | ||
|
||
it('Meridiem', () => { | ||
dayjs.locale(locale) | ||
expect(dayjs('2020-01-01 03:00:00').locale('ar-tn').format('A')).toEqual('ص') | ||
expect(dayjs('2020-01-01 11:00:00').locale('ar-tn').format('A')).toEqual('ص') | ||
expect(dayjs('2020-01-01 16:00:00').locale('ar-tn').format('A')).toEqual('م') | ||
expect(dayjs('2020-01-01 20:00:00').locale('ar-tn').format('A')).toEqual('م') | ||
}) |