Skip to content

Commit d40cd82

Browse files
feat(datetime): Improve time formatting for upcoming events (#800)
1 parent 628d656 commit d40cd82

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/utils/src/datetime.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export function formatTimeAgo(date: Date | string): string {
165165
const years = Math.floor(days / 365);
166166

167167
if (seconds < 5) {
168-
return i18n._("just now");
168+
return i18n._("Just now");
169169
} else if (seconds < 60) {
170170
return i18n._("{seconds} seconds ago", { seconds });
171171
} else if (minutes === 1) {
@@ -204,7 +204,7 @@ export function formatUpcomingTime(date: Date | string): string {
204204
const now = new Date();
205205

206206
if (futureDate <= now) {
207-
return i18n._("in progress");
207+
return i18n._("In progress");
208208
}
209209

210210
// Use calendar day difference calculation to be consistent with formatRelativeWithDay
@@ -220,15 +220,15 @@ export function formatUpcomingTime(date: Date | string): string {
220220
const hours = Math.floor(minutes / 60);
221221

222222
if (seconds < 60) {
223-
return i18n._("in {seconds} seconds", { seconds });
223+
return i18n._("Starting soon");
224224
} else if (minutes === 1) {
225-
return i18n._("in 1 minute");
225+
return i18n._("In 1 minute");
226226
} else if (minutes < 60) {
227-
return i18n._("in {minutes} minutes", { minutes });
227+
return i18n._("In {minutes} minutes", { minutes });
228228
} else if (hours === 1) {
229-
return i18n._("in 1 hour");
229+
return i18n._("In 1 hour");
230230
} else {
231-
return i18n._("in {hours} hours", { hours });
231+
return i18n._("In {hours} hours", { hours });
232232
}
233233
} else if (diffInDays === 1) {
234234
return i18n._("1 day later");

0 commit comments

Comments
 (0)