Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/addons/mod/feedback/pages/form/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h1>

<ion-select labelPlacement="stacked" *ngIf="item.templateName === 'multichoice-d'" [required]="item.required"
name="{{item.typ}}_{{item.id}}" [(ngModel)]="item.value" interface="action-sheet"
[cancelText]="'core.cancel' | translate" [interfaceOptions]="{header: item.name}">
[cancelText]="'core.cancel' | translate" [interfaceOptions]="{header: item.cleanedName}">
<ng-container *ngTemplateOutlet="label; context: {item: item}" />
<ion-select-option *ngFor="let option of item.choices" [value]="option.value">
<core-format-text [component]="component" [componentId]="cmId" [text]="option.label"
Expand Down
4 changes: 3 additions & 1 deletion src/addons/mod/feedback/services/feedback-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export class AddonModFeedbackHelperProvider {
const formItem: AddonModFeedbackNumericItem = Object.assign(item, {
templateName: AddonModFeedbackQuestionTemplateNames.NUMERIC,
value: item.rawValue !== undefined ? Number(item.rawValue) : '',
rangefrom: typeof rangeFrom == 'number' && !isNaN(rangeFrom) ? range[0] : '',
rangefrom: typeof rangeFrom == 'number' && !isNaN(rangeFrom) ? rangeFrom : '',
rangeto: typeof rangeTo == 'number' && !isNaN(rangeTo) ? rangeTo : '',
slottedLabel: true,
});
Expand Down Expand Up @@ -372,6 +372,7 @@ export class AddonModFeedbackHelperProvider {
value: '',
choices: [],
slottedLabel: subtype === AddonModFeedbackMultichoiceSubtype.DROPDOWN,
cleanedName: CoreText.cleanTags(item.name),
});

formItem.presentation = parts.length > 1 ? parts[1] : '';
Expand Down Expand Up @@ -592,6 +593,7 @@ export type AddonModFeedbackTextItem = AddonModFeedbackFormBasicItem & {
export type AddonModFeedbackMultichoiceItem = AddonModFeedbackFormBasicItem & {
subtype: AddonModFeedbackMultichoiceSubtype;
choices: { value: number; label: string; checked?: boolean }[];
cleanedName: string; // Name without HTML.
};

/**
Expand Down
10 changes: 10 additions & 0 deletions src/core/services/lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,16 @@ export class CoreLangProvider {
try {
await import('dayjs/locale/' + locale);
dayjs.locale(locale);

if (CorePlatform.isAutomated()) {
// Fix short names for automated tests to match the ones used in LMS. E.g. DayJS uses 'Jun' instead of 'June'.
dayjs.updateLocale('en-gb', {
monthsShort: [
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'June',
'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec',
],
});
}
} catch {
if (locale === 'en' || locale === 'en-gb') {
return;
Expand Down
1 change: 1 addition & 0 deletions src/core/singletons/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export class CoreTime {
];
if (CorePlatform.isAutomated()) {
plugins.push(import('dayjs/plugin/timezone'));
plugins.push(import('dayjs/plugin/updateLocale'));
}

const result = await Promise.all(plugins);
Expand Down
Loading