Skip to content

Commit b6c7967

Browse files
committed
MOBILE-4653 behat: Fix abbreviated month name missmatch with LMS
1 parent 930fed8 commit b6c7967

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/core/services/lang.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,16 @@ export class CoreLangProvider {
229229
try {
230230
await import('dayjs/locale/' + locale);
231231
dayjs.locale(locale);
232+
233+
if (CorePlatform.isAutomated()) {
234+
// Fix short names for automated tests to match the ones used in LMS. E.g. DayJS uses 'Jun' instead of 'June'.
235+
dayjs.updateLocale('en-gb', {
236+
monthsShort: [
237+
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'June',
238+
'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec',
239+
],
240+
});
241+
}
232242
} catch {
233243
if (locale === 'en' || locale === 'en-gb') {
234244
return;

src/core/singletons/time.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export class CoreTime {
146146
];
147147
if (CorePlatform.isAutomated()) {
148148
plugins.push(import('dayjs/plugin/timezone'));
149+
plugins.push(import('dayjs/plugin/updateLocale'));
149150
}
150151

151152
const result = await Promise.all(plugins);

0 commit comments

Comments
 (0)