Skip to content

Commit

Permalink
feat: DE46356 - Update BrightspaceUI to match core French date changes (
Browse files Browse the repository at this point in the history
  • Loading branch information
joshhoey authored Dec 15, 2021
1 parent e2858f1 commit 0602479
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions lib/dateTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ export function getDateTimeDescriptor() {
];
break;
case 'fr':
dateFormats = ['dddd\' le \'d MMMM yyyy', 'd MMM yyyy', 'dd/MM/yyyy', 'MMMM yyyy', 'd MMMM', 'd MMM'];
dateFormats = ['dddd 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 Down Expand Up @@ -877,13 +877,18 @@ export function getDateTimeDescriptor() {
dateFormats = ['dddd, d MMMM yyyy', 'dd MMMM yyyy', 'dd/MM/yyyy', 'MMMM yyyy', 'd MMMM', 'd MMM'];
break;
case 'fr-ca':
case 'fr-on':
dateFormats[1] = 'MMM d yyyy';
dateFormats[2] = 'yyyy-MM-dd';
dateFormats[4] = 'MMMM d';
dateFormats[5] = 'MMM d';
firstDayOfWeek = 0;
break;
case 'fr-on':
dateFormats[0] = 'dddd\' le \'d MMMM yyyy';
dateFormats[1] = 'MMM d yyyy';
dateFormats[2] = 'yyyy-MM-dd';
firstDayOfWeek = 0;
break;
case 'zh-tw':
days[0] = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
break;
Expand Down
8 changes: 4 additions & 4 deletions test/dateTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,10 +666,10 @@ describe('dateTime', () => {
{ locale: 'es', 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: 'es-ES', 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: '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-CA', expect: ['mardi le 4 juin 2019', 'juin 4 2019', '2019-06-04', 'juin 2019', 'juin 4', 'juin 4', '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-ON', expect: ['mardi le 4 juin 2019', 'juin 4 2019', '2019-06-04', 'juin 2019', 'juin 4', 'juin 4', 'mardi', 'mar.', 'juin', 'juin'] },
{ locale: 'fr', expect: ['mardi 4 juin 2019', '4 juin 2019', '04/06/2019', 'juin 2019', '4 juin', '4 juin', 'mardi', 'mar.', 'juin', 'juin'] },
{ locale: 'fr-CA', expect: ['mardi 4 juin 2019', 'juin 4 2019', '2019-06-04', 'juin 2019', 'juin 4', 'juin 4', 'mardi', 'mar.', 'juin', 'juin'] },
{ locale: 'fr-FR', expect: ['mardi 4 juin 2019', '4 juin 2019', '04/06/2019', 'juin 2019', '4 juin', '4 juin', 'mardi', 'mar.', 'juin', 'juin'] },
{ locale: 'fr-ON', expect: ['mardi le 4 juin 2019', 'juin 4 2019', '2019-06-04', 'juin 2019', '4 juin', '4 juin', '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월'] },
Expand Down

0 comments on commit 0602479

Please sign in to comment.