[Multi-language Support] No way of correctly translating time when messages were sent.
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
- Login to New Expensify
- Go to profile settings
- Click on Preferences and Change the language to Spanish
Expected Result:

Actual Result:

Workaround:
Visual Issue
Platform:
Where is this issue occurring?
- [ :heavy_check_mark: ] Web
- [ :heavy_check_mark: ] iOS
- [ :heavy_check_mark: ] Android
- [ :heavy_check_mark: ] Desktop App
- [ :heavy_check_mark: ] Mobile Web
Version Number: Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation Expensify/Expensify Issue URL:
Triggered auto assignment to @zanyrenney (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.
Proposal
- For proper date-time format, we need to make some changes in
timestampToDateTimefunction insideDateUtils.js
https://github.com/Expensify/App/blob/c00918712a050e92166954462c7b309164277d4e/src/libs/DateUtils.js#L56-L68
- Here, moment.js can't automatically change the
[ escaped characters ], so we can make use oftranslatefunction like this (after adding locales)
function timestampToDateTime(locale, timestamp, includeTimeZone = false) {
const date = getLocalMomentFromTimestamp(locale, timestamp);
const tz = includeTimeZone ? ' [UTC]Z' : '';
const todayAt = translate(locale, 'common.todayAt');
const tomorrowAt = translate(locale, 'common.tomorrowAt');
const yesterdayAt = translate(locale, 'common.yesterdayAt');
const at = translate(locale, 'common.conjunctionAt');
return moment(date).calendar({
sameDay: `[${todayAt}] LT${tz}`,
nextDay: `[${tomorrowAt}] LT${tz}`,
lastDay: `[${yesterdayAt}] LT${tz}`,
nextWeek: `MMM D [${at}] LT${tz}`,
lastWeek: `MMM D [${at}] LT${tz}`,
sameElse: `MMM D, YYYY [${at}] LT${tz}`,
});
}
Triggered auto assignment to @TomatoToaster (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
We can hold this issue until https://github.com/Expensify/App/pull/4090. I am adding a lot of missing translations there. After we should do an audit of the app to add all the missing translations and replace all the strings with translations whereever possible.
Translations can be added later but formatting date-time is still required which is the main issue here.
Triggered auto assignment to @kevinksullivan (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Alright I think this problem makes sense. Good catch! I like the proposal you made too, I think it makes sense for this problem.
In these cases, I'm not sure what the the next steps are. I think we just need the job to be made @kevinksullivan.
I renamed the title because I think it's more clear on what the problem is lmk what you think @aman-atg
Thanks @TomatoToaster
I renamed the title because I think it's more clear on what the problem is lmk what you think @aman-atg
LGTM
job posted
https://www.upwork.com/jobs/~010a0f724dd05272b1
@aman-atg add a proposal and I'll hire you!
Ah well the solution is merged, I think we just have the waiting period next.
Ah already paid this one!
@kevinksullivan yes, but I think I didn't get the bonus for this one. ( Link )
@aman-atg I don't have access to that page. Can you provide a screenshot?
Oh, sry about that.

Ah thanks, I see our approach to bonuses changed. All set @aman-atg !