Skip to content

Commit

Permalink
Adding shortMonthDay format
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisKraljevicD2L authored and dlockhart committed Oct 20, 2020
1 parent bd1e556 commit 74b849f
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 46 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ Options:
- **short**: abbreviated date format. e.g. `'9/23/2015'`
- **monthYear**: month and year only. e.g. `'September 2015'`
- **monthDay**: month and day only. e.g. `'September 23'`
- **shortMonthDay**: short month and day only. e.g. `'Sep 23'`
- **longDayOfWeek**: long weekday only. e.g. `'Wednesday'`
- **shortDayOfWeek**: short weekday only. e.g. `'Wed'`
- **longMonth**: long month only. e.g. `'September'`
Expand Down Expand Up @@ -220,4 +221,4 @@ Releases use the [semantic-release](https://semantic-release.gitbook.io/) toolin

Commits prefixed with `feat` will trigger a minor release, while `fix` or `perf` will trigger a patch release. A commit containing `BREAKING CHANGE` will cause a major release to occur.

Other useful prefixes that will not trigger a release: `build`, `ci`, `docs`, `refactor`, `style` and `test`. More details in the [Angular Contribution Guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#type).
Other useful prefixes that will not trigger a release: `build`, `ci`, `docs`, `refactor`, `style` and `test`. More details in the [Angular Contribution Guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#type).
30 changes: 16 additions & 14 deletions lib/dateTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ export function getDateTimeDescriptor() {

const timeFormat = getTimeFormat(hour24, language, baseLanguage);

let dateFormats = ['dddd, MMMM d, yyyy', 'MMM d, yyyy', 'M/d/yyyy', 'MMMM yyyy', 'MMMM d'];
let dateFormats = ['dddd, MMMM d, yyyy', 'MMM d, yyyy', 'M/d/yyyy', 'MMMM yyyy', 'MMMM d', 'MMM d'];
const fullTimeFormat = (baseLanguage === 'zh' && language !== 'zh-tw') ? `ZZZ ${timeFormat}` : `${timeFormat} ZZZ`;
let dayPeriods = ['AM', 'PM'];
let months = [
Expand All @@ -475,7 +475,7 @@ export function getDateTimeDescriptor() {

switch (baseLanguage) {
case 'ar':
dateFormats = ['dddd, d MMMM, yyyy', 'dd MMMM, yyyy', 'dd/MM/yyyy', 'MMMM, yyyy', 'd MMMM'];
dateFormats = ['dddd, d MMMM, yyyy', 'dd MMMM, yyyy', 'dd/MM/yyyy', 'MMMM, yyyy', 'd MMMM', 'd MMM'];
dayPeriods = ['ص', 'م'];
months[0] = months[1] = ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'];
days = [
Expand All @@ -488,7 +488,7 @@ export function getDateTimeDescriptor() {
weekendEndDay = 5;
break;
case 'da':
dateFormats = ['dddd \'den\' d. MMMM yyyy', 'd. MMM. yyyy', 'dd.MM.yyyy', 'MMMM yyyy', 'd. MMMM'];
dateFormats = ['dddd \'den\' d. MMMM yyyy', 'd. MMM. yyyy', 'dd.MM.yyyy', 'MMMM yyyy', 'd. MMMM', 'd. MMM'];
months = [
['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'],
['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.']
Expand All @@ -500,7 +500,7 @@ export function getDateTimeDescriptor() {
];
break;
case 'de':
dateFormats = ['dddd d. MMMM yyyy', 'd. MMMM yyyy', 'dd.MM.yyyy', 'MMMM yyyy', 'd. MMMM'];
dateFormats = ['dddd d. MMMM yyyy', 'd. MMMM yyyy', 'dd.MM.yyyy', 'MMMM yyyy', 'd. MMMM', 'd. MMM'];
months = [
['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
['Jan.', 'Feb.', 'März', 'Apr.', 'Mai', 'Juni', 'Juli', 'Aug.', 'Sept.', 'Okt.', 'Nov.', 'Dez.']
Expand All @@ -512,7 +512,7 @@ export function getDateTimeDescriptor() {
];
break;
case 'es':
dateFormats = ['dddd d\' de \'MMMM\' de \'yyyy', 'd\' de \'MMMM\' de \'yyyy', 'd/M/yyyy', 'MMMM yyyy', 'd\' de \'MMMM'];
dateFormats = ['dddd d\' de \'MMMM\' de \'yyyy', 'd\' de \'MMMM\' de \'yyyy', 'd/M/yyyy', 'MMMM yyyy', 'd\' de \'MMMM', 'd\' de \'MMM'];
dayPeriods = ['a. m.', 'p. m.'];
months = [
['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'],
Expand All @@ -525,7 +525,7 @@ export function getDateTimeDescriptor() {
];
break;
case 'fr':
dateFormats = ['dddd\' le \'d MMMM yyyy', 'd MMM yyyy', 'dd/MM/yyyy', 'MMMM yyyy', 'd MMMM'];
dateFormats = ['dddd\' le \'d MMMM yyyy', 'd MMM yyyy', 'dd/MM/yyyy', 'MMMM yyyy', 'd MMMM', 'd MMM'];
months = [
['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.']
Expand All @@ -537,20 +537,20 @@ export function getDateTimeDescriptor() {
];
break;
case 'ja':
dateFormats = ['yyyy年M月d日', 'yyyy年M月d日', 'yyyy/MM/dd', 'yyyy年M月', 'M月d日'];
dateFormats = ['yyyy年M月d日', 'yyyy年M月d日', 'yyyy/MM/dd', 'yyyy年M月', 'M月d日', 'M月d日'];
dayPeriods = ['午前', '午後'];
months[0] = months[1] = ['1 月', '2 月', '3 月', '4 月', '5 月', '6 月', '7 月', '8 月', '9 月', '10 月', '11 月', '12 月'];
days[0] = days[1] = days[2] = ['日', '月', '火', '水', '木', '金', '土'];
break;
case 'ko':
dateFormats = ['yyyy년 M월 d일 dddd', 'yyyy년 M월 d일', 'yyyy-MM-dd', 'yyyy년 M월', 'M월 d일'];
dateFormats = ['yyyy년 M월 d일 dddd', 'yyyy년 M월 d일', 'yyyy-MM-dd', 'yyyy년 M월', 'M월 d일', 'M월 d일'];
dayPeriods = ['오전', '오후'];
months[0] = months[1] = ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'];
days[0] = ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'];
days[1] = days[2] = ['일', '월', '화', '수', '목', '금', '토'];
break;
case 'nl':
dateFormats = ['dddd d MMMM yyyy', 'd MMMM yyyy', 'dd-MM-yyyy', 'MMMM yyyy', 'd MMMM'];
dateFormats = ['dddd d MMMM yyyy', 'd MMMM yyyy', 'dd-MM-yyyy', 'MMMM yyyy', 'd MMMM', 'd MMM'];
dayPeriods = ['a.m.', 'p.m.'];
months = [
['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
Expand All @@ -563,7 +563,7 @@ export function getDateTimeDescriptor() {
];
break;
case 'pt':
dateFormats = ['dddd, d\' de \'MMMM\' de \'yyyy', 'd\' de \'MMMM\' de \'yyyy', 'dd/MM/yyyy', 'MMMM\' de \'yyyy', 'dd\' de \'MMMM'];
dateFormats = ['dddd, d\' de \'MMMM\' de \'yyyy', 'd\' de \'MMMM\' de \'yyyy', 'dd/MM/yyyy', 'MMMM\' de \'yyyy', 'dd\' de \'MMMM', 'dd\' de \'MMM'];
months = [
['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'],
['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez']
Expand All @@ -575,7 +575,7 @@ export function getDateTimeDescriptor() {
];
break;
case 'sv':
dateFormats = ['dddd \'den\' d MMMM yyyy', 'd MMMM yyyy', 'yyyy-MM-dd', 'MMMM yyyy', 'dd MMMM'];
dateFormats = ['dddd \'den\' d MMMM yyyy', 'd MMMM yyyy', 'yyyy-MM-dd', 'MMMM yyyy', 'dd MMMM', 'dd MMM'];
dayPeriods = ['fm', 'em'];
months = [
['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december'],
Expand All @@ -588,7 +588,7 @@ export function getDateTimeDescriptor() {
];
break;
case 'tr':
dateFormats = ['dd MMMM yyyy dddd', 'dd MMMM yyyy', 'dd.MM.yyyy', 'MMMM yyyy', 'dd MMMM'];
dateFormats = ['dd MMMM yyyy dddd', 'dd MMMM yyyy', 'dd.MM.yyyy', 'MMMM yyyy', 'dd MMMM', 'dd MMM'];
dayPeriods = ['ÖÖ', 'ÖS'];
months = [
['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'],
Expand All @@ -601,7 +601,7 @@ export function getDateTimeDescriptor() {
];
break;
case 'zh':
dateFormats = ['yyyy年M月d日', 'yyyy年M月d日', 'yyyy/M/d', 'yyyy年M月', 'M月d日'];
dateFormats = ['yyyy年M月d日', 'yyyy年M月d日', 'yyyy/M/d', 'yyyy年M月', 'M月d日', 'M月d日'];
dayPeriods = ['上午', '下午'];
months[0] = months[1] = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
days[0] = days[1] = ['週日', '週一', '週二', '週三', '週四', '週五', '週六'];
Expand All @@ -611,7 +611,7 @@ export function getDateTimeDescriptor() {

switch (language) {
case 'en-gb':
dateFormats = ['dddd, d MMMM yyyy', 'dd MMMM yyyy', 'dd/MM/yyyy', 'MMMM yyyy', 'd MMMM'];
dateFormats = ['dddd, d MMMM yyyy', 'dd MMMM yyyy', 'dd/MM/yyyy', 'MMMM yyyy', 'd MMMM', 'd MMM'];
break;
case 'es-mx':
dateFormats[2] = 'dd/MM/yyyy';
Expand All @@ -620,6 +620,7 @@ export function getDateTimeDescriptor() {
dateFormats[1] = 'MMM d yyyy';
dateFormats[2] = 'yyyy-MM-dd';
dateFormats[4] = 'MMMM d';
dateFormats[5] = 'MMM d';
firstDayOfWeek = 0;
break;
case 'zh-tw':
Expand All @@ -636,6 +637,7 @@ export function getDateTimeDescriptor() {
'short': dateFormats[2],
'monthYear': dateFormats[3],
'monthDay': dateFormats[4],
'shortMonthDay': dateFormats[5],
'longDayOfWeek': 'dddd',
'shortDayOfWeek': 'ddd',
'longMonth': 'MMMM',
Expand Down
64 changes: 33 additions & 31 deletions test/dateTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ describe('dateTime', () => {
{ format: 'short', expect: '8/3/2015' },
{ format: 'monthYear', expect: 'August 2015' },
{ format: 'monthDay', expect: 'August 3' },
{ format: 'shortMonthDay', expect: 'Aug 3' },
{ format: 'longDayOfWeek', expect: 'Monday' },
{ format: 'shortDayOfWeek', expect: 'Mon' },
{ format: 'longMonth', expect: 'August' },
Expand All @@ -636,39 +637,39 @@ describe('dateTime', () => {
});

[
{ locale: 'ar', expect: ['الثلاثاء, 4 يونيو, 2019', '04 يونيو, 2019', '04/06/2019', 'يونيو, 2019', '4 يونيو', 'الثلاثاء', 'ثلاثاء', 'يونيو', 'يونيو'] },
{ locale: 'ar-SA', expect: ['الثلاثاء, 4 يونيو, 2019', '04 يونيو, 2019', '04/06/2019', 'يونيو, 2019', '4 يونيو', 'الثلاثاء', 'ثلاثاء', 'يونيو', 'يونيو'] },
{ locale: 'da', expect: ['tirsdag den 4. juni 2019', '4. jun.. 2019', '04.06.2019', 'juni 2019', '4. juni', 'tirsdag', 'tir.', 'juni', 'jun.'] },
{ locale: 'da-DK', expect: ['tirsdag den 4. juni 2019', '4. jun.. 2019', '04.06.2019', 'juni 2019', '4. juni', 'tirsdag', 'tir.', 'juni', 'jun.'] },
{ locale: 'de', expect: ['Dienstag 4. Juni 2019', '4. Juni 2019', '04.06.2019', 'Juni 2019', '4. Juni', 'Dienstag', 'Di.', 'Juni', 'Juni'] },
{ locale: 'de-DE', expect: ['Dienstag 4. Juni 2019', '4. Juni 2019', '04.06.2019', 'Juni 2019', '4. Juni', 'Dienstag', 'Di.', 'Juni', 'Juni'] },
{ locale: 'en', expect: ['Tuesday, June 4, 2019', 'Jun 4, 2019', '6/4/2019', 'June 2019', 'June 4', 'Tuesday', 'Tue', 'June', 'Jun'] },
{ locale: 'en-CA', expect: ['Tuesday, June 4, 2019', 'Jun 4, 2019', '6/4/2019', 'June 2019', 'June 4', 'Tuesday', 'Tue', 'June', 'Jun'] },
{ locale: 'en-GB', expect: ['Tuesday, 4 June 2019', '04 June 2019', '04/06/2019', 'June 2019', '4 June', 'Tuesday', 'Tue', 'June', 'Jun'] },
{ locale: 'en-US', expect: ['Tuesday, June 4, 2019', 'Jun 4, 2019', '6/4/2019', 'June 2019', 'June 4', 'Tuesday', 'Tue', 'June', 'Jun'] },
{ locale: 'es', expect: ['martes 4 de junio de 2019', '4 de junio de 2019', '4/6/2019', 'junio 2019', '4 de junio', 'martes', 'mar.', 'junio', 'jun.'] },
{ locale: 'es-MX', expect: ['martes 4 de junio de 2019', '4 de junio de 2019', '04/06/2019', 'junio 2019', '4 de junio', 'martes', 'mar.', 'junio', 'jun.'] },
{ locale: 'fr', expect: ['mardi le 4 juin 2019', '4 juin 2019', '04/06/2019', 'juin 2019', '4 juin', 'mardi', 'mar.', 'juin', 'juin'] },
{ locale: 'fr-FR', expect: ['mardi le 4 juin 2019', '4 juin 2019', '04/06/2019', 'juin 2019', '4 juin', 'mardi', 'mar.', 'juin', 'juin'] },
{ locale: 'fr-CA', expect: ['mardi le 4 juin 2019', 'juin 4 2019', '2019-06-04', 'juin 2019', 'juin 4', 'mardi', 'mar.', 'juin', 'juin'] },
{ locale: 'ja', expect: ['2019年6月4日', '2019年6月4日', '2019/06/04', '2019年6月', '6月4日', '火', '火', '6 月', '6 月'] },
{ locale: 'ja-JP', expect: ['2019年6月4日', '2019年6月4日', '2019/06/04', '2019年6月', '6月4日', '火', '火', '6 月', '6 月'] },
{ locale: 'ko', expect: ['2019년 6월 4일 화요일', '2019년 6월 4일', '2019-06-04', '2019년 6월', '6월 4일', '화요일', '화', '6월', '6월'] },
{ locale: 'ko-KR', expect: ['2019년 6월 4일 화요일', '2019년 6월 4일', '2019-06-04', '2019년 6월', '6월 4일', '화요일', '화', '6월', '6월'] },
{ locale: 'nl', expect: ['dinsdag 4 juni 2019', '4 juni 2019', '04-06-2019', 'juni 2019', '4 juni', 'dinsdag', 'di', 'juni', 'jun.'] },
{ locale: 'nl-NL', expect: ['dinsdag 4 juni 2019', '4 juni 2019', '04-06-2019', 'juni 2019', '4 juni', 'dinsdag', 'di', 'juni', 'jun.'] },
{ locale: 'pt', expect: ['terça-feira, 4 de junho de 2019', '4 de junho de 2019', '04/06/2019', 'junho de 2019', '04 de junho', 'terça-feira', 'ter', 'junho', 'jun'] },
{ locale: 'pt-BR', expect: ['terça-feira, 4 de junho de 2019', '4 de junho de 2019', '04/06/2019', 'junho de 2019', '04 de junho', 'terça-feira', 'ter', 'junho', 'jun'] },
{ locale: 'sv', expect: ['Tisdag den 4 juni 2019', '4 juni 2019', '2019-06-04', 'juni 2019', '04 juni', 'Tisdag', 'Tis', 'juni', 'juni'] },
{ locale: 'sv-SE', expect: ['Tisdag den 4 juni 2019', '4 juni 2019', '2019-06-04', 'juni 2019', '04 juni', 'Tisdag', 'Tis', 'juni', 'juni'] },
{ locale: 'tr', expect: ['04 Haziran 2019 Salı', '04 Haziran 2019', '04.06.2019', 'Haziran 2019', '04 Haziran', 'Salı', 'Sal', 'Haziran', 'Haz'] },
{ locale: 'tr-TR', expect: ['04 Haziran 2019 Salı', '04 Haziran 2019', '04.06.2019', 'Haziran 2019', '04 Haziran', 'Salı', 'Sal', 'Haziran', 'Haz'] },
{ locale: 'zh', expect: ['2019年6月4日', '2019年6月4日', '2019/6/4', '2019年6月', '6月4日', '週二', '週二', '六月', '六月'] },
{ locale: 'zh-CN', expect: ['2019年6月4日', '2019年6月4日', '2019/6/4', '2019年6月', '6月4日', '週二', '週二', '六月', '六月'] },
{ locale: 'zh-TW', expect: ['2019年6月4日', '2019年6月4日', '2019/6/4', '2019年6月', '6月4日', '星期二', '週二', '六月', '六月'] }
{ locale: 'ar', expect: ['الثلاثاء, 4 يونيو, 2019', '04 يونيو, 2019', '04/06/2019', 'يونيو, 2019', '4 يونيو', '4 يونيو', 'الثلاثاء', 'ثلاثاء', 'يونيو', 'يونيو'] },
{ locale: 'ar-SA', expect: ['الثلاثاء, 4 يونيو, 2019', '04 يونيو, 2019', '04/06/2019', 'يونيو, 2019', '4 يونيو', '4 يونيو', 'الثلاثاء', 'ثلاثاء', 'يونيو', 'يونيو'] },
{ locale: 'da', expect: ['tirsdag den 4. juni 2019', '4. jun.. 2019', '04.06.2019', 'juni 2019', '4. juni', '4. jun.', 'tirsdag', 'tir.', 'juni', 'jun.'] },
{ locale: 'da-DK', expect: ['tirsdag den 4. juni 2019', '4. jun.. 2019', '04.06.2019', 'juni 2019', '4. juni', '4. jun.', 'tirsdag', 'tir.', 'juni', 'jun.'] },
{ locale: 'de', expect: ['Dienstag 4. Juni 2019', '4. Juni 2019', '04.06.2019', 'Juni 2019', '4. Juni', '4. Juni', 'Dienstag', 'Di.', 'Juni', 'Juni'] },
{ locale: 'de-DE', expect: ['Dienstag 4. Juni 2019', '4. Juni 2019', '04.06.2019', 'Juni 2019', '4. Juni', '4. Juni', 'Dienstag', 'Di.', 'Juni', 'Juni'] },
{ locale: 'en', expect: ['Tuesday, June 4, 2019', 'Jun 4, 2019', '6/4/2019', 'June 2019', 'June 4', 'Jun 4', 'Tuesday', 'Tue', 'June', 'Jun'] },
{ locale: 'en-CA', expect: ['Tuesday, June 4, 2019', 'Jun 4, 2019', '6/4/2019', 'June 2019', 'June 4', 'Jun 4', 'Tuesday', 'Tue', 'June', 'Jun'] },
{ locale: 'en-GB', expect: ['Tuesday, 4 June 2019', '04 June 2019', '04/06/2019', 'June 2019', '4 June', '4 Jun', 'Tuesday', 'Tue', 'June', 'Jun'] },
{ locale: 'en-US', expect: ['Tuesday, June 4, 2019', 'Jun 4, 2019', '6/4/2019', 'June 2019', 'June 4', 'Jun 4', 'Tuesday', 'Tue', 'June', 'Jun'] },
{ locale: 'es', expect: ['martes 4 de junio de 2019', '4 de junio de 2019', '4/6/2019', 'junio 2019', '4 de junio', '4 de jun.', 'martes', 'mar.', 'junio', 'jun.'] },
{ locale: 'es-MX', expect: ['martes 4 de junio de 2019', '4 de junio de 2019', '04/06/2019', 'junio 2019', '4 de junio', '4 de jun.', 'martes', 'mar.', 'junio', 'jun.'] },
{ locale: 'fr', expect: ['mardi le 4 juin 2019', '4 juin 2019', '04/06/2019', 'juin 2019', '4 juin', '4 juin', 'mardi', 'mar.', 'juin', 'juin'] },
{ locale: 'fr-FR', expect: ['mardi le 4 juin 2019', '4 juin 2019', '04/06/2019', 'juin 2019', '4 juin', '4 juin', 'mardi', 'mar.', 'juin', 'juin'] },
{ locale: 'fr-CA', expect: ['mardi le 4 juin 2019', 'juin 4 2019', '2019-06-04', 'juin 2019', 'juin 4', 'juin 4', 'mardi', 'mar.', 'juin', 'juin'] },
{ locale: 'ja', expect: ['2019年6月4日', '2019年6月4日', '2019/06/04', '2019年6月', '6月4日', '6月4日', '火', '火', '6 月', '6 月'] },
{ locale: 'ja-JP', expect: ['2019年6月4日', '2019年6月4日', '2019/06/04', '2019年6月', '6月4日', '6月4日', '火', '火', '6 月', '6 月'] },
{ locale: 'ko', expect: ['2019년 6월 4일 화요일', '2019년 6월 4일', '2019-06-04', '2019년 6월', '6월 4일', '6월 4일', '화요일', '화', '6월', '6월'] },
{ locale: 'ko-KR', expect: ['2019년 6월 4일 화요일', '2019년 6월 4일', '2019-06-04', '2019년 6월', '6월 4일', '6월 4일', '화요일', '화', '6월', '6월'] },
{ locale: 'nl', expect: ['dinsdag 4 juni 2019', '4 juni 2019', '04-06-2019', 'juni 2019', '4 juni', '4 jun.', 'dinsdag', 'di', 'juni', 'jun.'] },
{ locale: 'nl-NL', expect: ['dinsdag 4 juni 2019', '4 juni 2019', '04-06-2019', 'juni 2019', '4 juni', '4 jun.', 'dinsdag', 'di', 'juni', 'jun.'] },
{ locale: 'pt', expect: ['terça-feira, 4 de junho de 2019', '4 de junho de 2019', '04/06/2019', 'junho de 2019', '04 de junho', '04 de jun', 'terça-feira', 'ter', 'junho', 'jun'] },
{ locale: 'pt-BR', expect: ['terça-feira, 4 de junho de 2019', '4 de junho de 2019', '04/06/2019', 'junho de 2019', '04 de junho', '04 de jun', 'terça-feira', 'ter', 'junho', 'jun'] },
{ locale: 'sv', expect: ['Tisdag den 4 juni 2019', '4 juni 2019', '2019-06-04', 'juni 2019', '04 juni', '04 juni', 'Tisdag', 'Tis', 'juni', 'juni'] },
{ locale: 'sv-SE', expect: ['Tisdag den 4 juni 2019', '4 juni 2019', '2019-06-04', 'juni 2019', '04 juni', '04 juni', 'Tisdag', 'Tis', 'juni', 'juni'] },
{ locale: 'tr', expect: ['04 Haziran 2019 Salı', '04 Haziran 2019', '04.06.2019', 'Haziran 2019', '04 Haziran', '04 Haz', 'Salı', 'Sal', 'Haziran', 'Haz'] },
{ locale: 'tr-TR', expect: ['04 Haziran 2019 Salı', '04 Haziran 2019', '04.06.2019', 'Haziran 2019', '04 Haziran', '04 Haz', 'Salı', 'Sal', 'Haziran', 'Haz'] },
{ locale: 'zh', expect: ['2019年6月4日', '2019年6月4日', '2019/6/4', '2019年6月', '6月4日', '6月4日', '週二', '週二', '六月', '六月'] },
{ locale: 'zh-CN', expect: ['2019年6月4日', '2019年6月4日', '2019/6/4', '2019年6月', '6月4日', '6月4日', '週二', '週二', '六月', '六月'] },
{ locale: 'zh-TW', expect: ['2019年6月4日', '2019年6月4日', '2019/6/4', '2019年6月', '6月4日', '6月4日', '星期二', '週二', '六月', '六月'] }
].forEach((input) => {
let index = -1;
['full', 'medium', 'short', 'monthYear', 'monthDay', 'longDayOfWeek', 'shortDayOfWeek', 'longMonth', 'shortMonth'].forEach((format) => {
['full', 'medium', 'short', 'monthYear', 'monthDay', 'shortMonthDay', 'longDayOfWeek', 'shortDayOfWeek', 'longMonth', 'shortMonth'].forEach((format) => {
it(`should format ${input.locale}/${format}`, () => {
documentLocaleSettings.language = input.locale;
index++;
Expand Down Expand Up @@ -810,6 +811,7 @@ describe('dateTime', () => {
{ format: 'short', expect: '8/3/2015 1:44 PM' },
{ format: 'monthYear', expect: 'August 2015' },
{ format: 'monthDay', expect: 'August 3' },
{ format: 'shortMonthDay', expect: 'Aug 3' },
{ format: 'longDayOfWeek', expect: 'Monday' },
{ format: 'shortDayOfWeek', expect: 'Mon' },
{ format: 'longMonth', expect: 'August' },
Expand Down

0 comments on commit 74b849f

Please sign in to comment.