Skip to content

Commit 533293b

Browse files
committed
Use the designated locale for per-message timestamps.
1 parent d4a8e0c commit 533293b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ts/components/conversation/message/message-item/DateBreak.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import moment from 'moment';
22
import React from 'react';
33
import styled from 'styled-components';
4+
import { sync as osLocaleSync } from 'os-locale';
45

56
const DateBreakContainer = styled.div``;
67

@@ -26,7 +27,7 @@ export const MessageDateBreak = (props: { timestamp: number; messageId: string }
2627
sameElse: 'LL',
2728
}
2829
} else {
29-
moment.locale('en-gb'); // for 24-hour clock
30+
moment.locale(osLocaleSync().replace(/_/g, '-'));
3031
dateFormat = {
3132
sameElse: 'llll',
3233
}

0 commit comments

Comments
 (0)