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> {
167167
168168 @override
169169 Widget build (BuildContext context) {
170+ final zulipLocalizations = ZulipLocalizations .of (context);
170171 final store = PerAccountStoreWidget .of (context);
171172 final themeData = Theme .of (context);
172173
@@ -176,8 +177,8 @@ class _LightboxPageLayoutState extends State<_LightboxPageLayout> {
176177
177178 PreferredSizeWidget ? appBar;
178179 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 );
181182
182183 // We use plain [AppBar] instead of [ZulipAppBar], even though this page
183184 // has a [PerAccountStore], because:
Original file line number Diff line number Diff line change @@ -1915,12 +1915,14 @@ class SenderRow extends StatelessWidget {
19151915
19161916 @override
19171917 Widget build (BuildContext context) {
1918+ final zulipLocalizations = ZulipLocalizations .of (context);
19181919 final store = PerAccountStoreWidget .of (context);
19191920 final messageListTheme = MessageListTheme .of (context);
19201921 final designVariables = DesignVariables .of (context);
19211922
19221923 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);
19241926
19251927 final showAsMuted = _showAsMuted (context, store);
19261928
@@ -2010,7 +2012,11 @@ enum MessageTimestampStyle {
20102012
20112013 /// Format a [Message.timestamp] for this mode.
20122014 // 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+ }) {
20142020 final asDateTime =
20152021 DateTime .fromMillisecondsSinceEpoch (1000 * messageTimestamp);
20162022
You can’t perform that action at this time.
0 commit comments