🐛 Fix timezone error

This commit is contained in:
2025-11-02 17:24:18 +08:00
parent e70439870e
commit f542d9fa97
3 changed files with 30 additions and 32 deletions

View File

@@ -470,6 +470,7 @@
"pronouns": "Pronouns", "pronouns": "Pronouns",
"location": "Location", "location": "Location",
"timeZone": "Time Zone", "timeZone": "Time Zone",
"timezoneNotFound": "Time zone not found",
"birthday": "Birthday", "birthday": "Birthday",
"selectADate": "Select a date", "selectADate": "Select a date",
"checkInResultT0": "Worst", "checkInResultT0": "Worst",

View File

@@ -332,30 +332,34 @@ class _AccountProfileDetail extends StatelessWidget {
children: _buildSubcolumn(), children: _buildSubcolumn(),
), ),
if (data.profile.timeZone.isNotEmpty && !kIsWeb) if (data.profile.timeZone.isNotEmpty && !kIsWeb)
Column( Builder(
crossAxisAlignment: CrossAxisAlignment.start, builder: (context) {
children: [ try {
Text('timeZone').tr().bold(), final tzInfo = getTzInfo(data.profile.timeZone);
Row( return Column(
crossAxisAlignment: CrossAxisAlignment.baseline, crossAxisAlignment: CrossAxisAlignment.start,
textBaseline: TextBaseline.alphabetic, children: [
spacing: 6, Text('timeZone').tr().bold(),
children: [ Row(
Text(data.profile.timeZone), crossAxisAlignment: CrossAxisAlignment.baseline,
Text( textBaseline: TextBaseline.alphabetic,
getTzInfo( spacing: 6,
data.profile.timeZone, children: [
).$2.formatCustomGlobal('HH:mm'), Text(data.profile.timeZone),
), Text(tzInfo.$2.formatCustomGlobal('HH:mm')),
Text( Text(tzInfo.$1.formatOffsetLocal()).fontSize(11),
getTzInfo(data.profile.timeZone).$1.formatOffsetLocal(), Text(
).fontSize(11), 'UTC${tzInfo.$1.formatOffset()}',
Text( ).fontSize(11).opacity(0.75),
'UTC${getTzInfo(data.profile.timeZone).$1.formatOffset()}', ],
).fontSize(11).opacity(0.75), ),
], ],
), );
], } catch (e) {
// Hide timezone section if timezone is invalid
return const SizedBox.shrink();
}
},
), ),
], ],
).padding(horizontal: 24, vertical: 16), ).padding(horizontal: 24, vertical: 16),

View File

@@ -21,7 +21,6 @@ import 'package:island/widgets/response.dart';
import 'package:material_symbols_icons/symbols.dart'; import 'package:material_symbols_icons/symbols.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:styled_widget/styled_widget.dart'; import 'package:styled_widget/styled_widget.dart';
import 'package:url_launcher/url_launcher_string.dart';
part 'hub.g.dart'; part 'hub.g.dart';
@@ -190,13 +189,7 @@ class _ConsoleAppBar extends StatelessWidget implements PreferredSizeWidget {
currentProject: currentProject, currentProject: currentProject,
onProjectChanged: onProjectChanged, onProjectChanged: onProjectChanged,
), ),
IconButton( const Gap(8),
icon: const Icon(Symbols.help, color: Color(0xFF5F6368)),
onPressed: () {
launchUrlString('https://kb.solsynth.dev');
},
),
const Gap(12),
], ],
); );
} }