new UI + new targets.

This commit is contained in:
Jan Pleterski
2026-11-27 14:37:44 +01:00
parent 5f9e2a3b86
commit 2fc741a9f6
113 changed files with 6861 additions and 7381 deletions
+18
View File
@@ -0,0 +1,18 @@
import 'package:intl/intl.dart';
import '../services/app_settings.dart';
/// Decimal number the way the language writes it: 8,49 (sl, de) or 8.49 (en).
String dec(double v, [int digits = 2]) {
final s = v.toStringAsFixed(digits);
return AppSettings.instance.language == 'English' ? s : s.replaceAll('.', ',');
}
/// Signed difference: "+0,21" / "−0,06".
String signedDec(double v, [int digits = 2]) => '${v >= 0 ? '+' : '−'}${dec(v.abs(), digits)}';
/// "čet, 12. 11." (or with the year): weekday without the locale's dot.
String dayDate(DateTime d, {bool year = false}) {
final s = AppSettings.instance;
final weekday = DateFormat('EEE', s.dateLocale).format(d).replaceAll('.', '');
return '$weekday, ${DateFormat(year ? 'd. M. yyyy' : 'd. M.').format(d)}';
}