Skip to content

Commit 3b9788f

Browse files
[activity-feed] Fix date formatting literal for Safari simplify date return (#4783)
## Description This pull request simplifies the date formatting logic in the `ActivityFeedStepComponent` by removing custom string manipulation and returning the formatted date directly. - Simplified date formatting in `ActivityFeedStepComponent` by returning the result of `#intlDateTimeFormat.format(date)` directly, instead of splitting and reconstructing the formatted string. ----- -----
1 parent 5a50158 commit 3b9788f

3 files changed

Lines changed: 1 addition & 12 deletions

File tree

packages/ng/activity-feed/activity-feed-step/activity-feed-step.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ export class ActivityFeedStepComponent {
5656
if (!date) {
5757
return null;
5858
}
59-
const formatted = this.#intlDateTimeFormat.format(date);
60-
const parts = formatted.split(', ');
61-
return `${parts[0].charAt(0).toUpperCase() + parts[0].slice(1)} ${this.intl().at} ${parts[1]}`;
59+
return this.#intlDateTimeFormat.format(date);
6260
});
6361
}

packages/ng/activity-feed/activity-feed.translate.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export const LU_ACTIVITY_FEED_TRANSLATIONS = new InjectionToken('luActivityFeedT
88

99
export interface ActivityFeedTranslate {
1010
replaceByAlt: string;
11-
at: string;
1211
}
1312

1413
export const luActivityFeedTranslations: LuTranslation<ActivityFeedTranslate> = Translations;
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,26 @@
11
export const Translations = {
22
'nl-BE': {
33
replaceByAlt: 'is vervangen door',
4-
at: 'tot',
54
},
65
fr: {
76
replaceByAlt: 'à été remplacé par',
8-
at: 'à',
97
},
108
de: {
119
replaceByAlt: 'wurde ersetzt durch',
12-
at: 'in',
1310
},
1411
en: {
1512
replaceByAlt: 'has been replaced by',
16-
at: 'to',
1713
},
1814
es: {
1915
replaceByAlt: 'ha sido sustituido por',
20-
at: 'a',
2116
},
2217
it: {
2318
replaceByAlt: 'è stato sostituito da',
24-
at: 'a',
2519
},
2620
nl: {
2721
replaceByAlt: 'is vervangen door',
28-
at: 'tot',
2922
},
3023
pt: {
3124
replaceByAlt: 'foi substituído por',
32-
at: 'à',
3325
},
3426
};

0 commit comments

Comments
 (0)