File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,7 @@ class _LightboxPageLayoutState extends State<_LightboxPageLayout> {
167
167
168
168
@override
169
169
Widget build (BuildContext context) {
170
+ final zulipLocalizations = ZulipLocalizations .of (context);
170
171
final store = PerAccountStoreWidget .of (context);
171
172
final themeData = Theme .of (context);
172
173
@@ -176,8 +177,8 @@ class _LightboxPageLayoutState extends State<_LightboxPageLayout> {
176
177
177
178
PreferredSizeWidget ? appBar;
178
179
if (_headerFooterVisible) {
179
- final timestampText = MessageTimestampStyle .lightbox
180
- . format ( widget.message.timestamp);
180
+ final timestampText = MessageTimestampStyle .lightbox. format (
181
+ widget.message.timestamp, now : DateTime . now (), zulipLocalizations : zulipLocalizations );
181
182
182
183
// We use plain [AppBar] instead of [ZulipAppBar], even though this page
183
184
// has a [PerAccountStore], because:
Original file line number Diff line number Diff line change @@ -1915,12 +1915,14 @@ class SenderRow extends StatelessWidget {
1915
1915
1916
1916
@override
1917
1917
Widget build (BuildContext context) {
1918
+ final zulipLocalizations = ZulipLocalizations .of (context);
1918
1919
final store = PerAccountStoreWidget .of (context);
1919
1920
final messageListTheme = MessageListTheme .of (context);
1920
1921
final designVariables = DesignVariables .of (context);
1921
1922
1922
1923
final sender = store.getUser (message.senderId);
1923
- final timestamp = timestampStyle.format (message.timestamp);
1924
+ final timestamp = timestampStyle.format (
1925
+ message.timestamp, now: DateTime .now (), zulipLocalizations: zulipLocalizations);
1924
1926
1925
1927
final showAsMuted = _showAsMuted (context, store);
1926
1928
@@ -2010,7 +2012,11 @@ enum MessageTimestampStyle {
2010
2012
2011
2013
/// Format a [Message.timestamp] for this mode.
2012
2014
// TODO(i18n): locale-specific formatting (see #45 for a plan with ffi)
2013
- String ? format (int messageTimestamp) {
2015
+ String ? format (
2016
+ int messageTimestamp, {
2017
+ required DateTime now,
2018
+ required ZulipLocalizations zulipLocalizations,
2019
+ }) {
2014
2020
final asDateTime =
2015
2021
DateTime .fromMillisecondsSinceEpoch (1000 * messageTimestamp);
2016
2022
You can’t perform that action at this time.
0 commit comments