-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1054 from iamkun/dev
D2M
- Loading branch information
Showing
19 changed files
with
261 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ coverage | |
/dayjs.min.js | ||
/esm | ||
/index.d.ts | ||
locale.json | ||
|
||
#dev | ||
demo.js |
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ cache: | |
- ~/.npm | ||
- node_modules | ||
node_js: | ||
- '14' | ||
- '12' | ||
- '10' | ||
- '8' | ||
|
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,41 @@ | ||
// Amharic [am] | ||
import dayjs from 'dayjs' | ||
|
||
const locale = { | ||
name: 'am', | ||
weekdays: 'እሑድ_ሰኞ_ማክሰኞ_ረቡዕ_ሐሙስ_አርብ_ቅዳሜ'.split('_'), | ||
weekdaysShort: 'እሑድ_ሰኞ_ማክሰ_ረቡዕ_ሐሙስ_አርብ_ቅዳሜ'.split('_'), | ||
weekdaysMin: 'እሑ_ሰኞ_ማክ_ረቡ_ሐሙ_አር_ቅዳ'.split('_'), | ||
months: 'ጃንዋሪ_ፌብሯሪ_ማርች_ኤፕሪል_ሜይ_ጁን_ጁላይ_ኦገስት_ሴፕቴምበር_ኦክቶበር_ኖቬምበር_ዲሴምበር'.split('_'), | ||
monthsShort: 'ጃንዋ_ፌብሯ_ማርች_ኤፕሪ_ሜይ_ጁን_ጁላይ_ኦገስ_ሴፕቴ_ኦክቶ_ኖቬም_ዲሴም'.split('_'), | ||
weekStart: 1, | ||
yearStart: 4, | ||
relativeTime: { | ||
future: 'በ%s', | ||
past: '%s በፊት', | ||
s: 'ጥቂት ሰከንዶች', | ||
m: 'አንድ ደቂቃ', | ||
mm: '%d ደቂቃዎች', | ||
h: 'አንድ ሰዓት', | ||
hh: '%d ሰዓታት', | ||
d: 'አንድ ቀን', | ||
dd: '%d ቀናት', | ||
M: 'አንድ ወር', | ||
MM: '%d ወራት', | ||
y: 'አንድ ዓመት', | ||
yy: '%d ዓመታት' | ||
}, | ||
formats: { | ||
LT: 'HH:mm', | ||
LTS: 'HH:mm:ss', | ||
L: 'DD/MM/YYYY', | ||
LL: 'MMMM D ፣ YYYY', | ||
LLL: 'MMMM D ፣ YYYY HH:mm', | ||
LLLL: 'dddd ፣ MMMM D ፣ YYYY HH:mm' | ||
}, | ||
ordinal: n => `${n}ኛ` | ||
} | ||
|
||
dayjs.locale(locale, null, true) | ||
|
||
export default locale |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Bislama [bi] | ||
import dayjs from 'dayjs' | ||
|
||
const locale = { | ||
|
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,18 @@ | ||
import moment from 'moment' | ||
import dayjs from '../../src' | ||
import '../../src/locale/hr' | ||
|
||
it('Format month with locale function', () => { | ||
for (let i = 0; i <= 7; i += 1) { | ||
const dayjsUK = dayjs().locale('hr').add(i, 'day') | ||
const momentUK = moment().locale('hr').add(i, 'day') | ||
const testFormat1 = 'DD MMMM YYYY MMM' | ||
const testFormat2 = 'dddd, MMMM D YYYY' | ||
const testFormat3 = 'MMMM' | ||
const testFormat4 = 'MMM' | ||
expect(dayjsUK.format(testFormat1)).toEqual(momentUK.format(testFormat1)) | ||
expect(dayjsUK.format(testFormat2)).toEqual(momentUK.format(testFormat2)) | ||
expect(dayjsUK.format(testFormat3)).toEqual(momentUK.format(testFormat3)) | ||
expect(dayjsUK.format(testFormat4)).toEqual(momentUK.format(testFormat4)) | ||
} | ||
}) |
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,18 @@ | ||
import moment from 'moment' | ||
import dayjs from '../../src' | ||
import '../../src/locale/lt' | ||
|
||
it('Format month with locale function', () => { | ||
for (let i = 0; i <= 7; i += 1) { | ||
const dayjsUK = dayjs().locale('lt').add(i, 'day') | ||
const momentUK = moment().locale('lt').add(i, 'day') | ||
const testFormat1 = 'DD MMMM YYYY MMM' | ||
const testFormat2 = 'dddd, MMMM D YYYY' | ||
const testFormat3 = 'MMMM' | ||
const testFormat4 = 'MMM' | ||
expect(dayjsUK.format(testFormat1)).toEqual(momentUK.format(testFormat1)) | ||
expect(dayjsUK.format(testFormat2)).toEqual(momentUK.format(testFormat2)) | ||
expect(dayjsUK.format(testFormat3)).toEqual(momentUK.format(testFormat3)) | ||
expect(dayjsUK.format(testFormat4)).toEqual(momentUK.format(testFormat4)) | ||
} | ||
}) |
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
Oops, something went wrong.