Umstellung auf UTC Timestamp
This commit is contained in:
1 parent
fcb3ecdbb4
commit
d5ec222efd
41 files changed
+145
-665
No files matched your search
+10
-3
@@ -18,6 +18,13 @@ import '../Tools/colored_safe_area.dart';
|
||||
class Util {
|
||||
static late SharedPreferences prefs;
|
||||
|
||||
// DateTime → UTC Unix timestamps
|
||||
static int toUnixMillisUtc(DateTime dt) => dt.toUtc().millisecondsSinceEpoch;
|
||||
static int nowUnixMillisUtc() => DateTime.now().toUtc().millisecondsSinceEpoch;
|
||||
// Optional: Unix seconds
|
||||
static int toUnixSecondsUtc(DateTime dt) => dt.toUtc().millisecondsSinceEpoch ~/ 1000;
|
||||
|
||||
|
||||
static init() async {
|
||||
prefs = await SharedPreferences.getInstance();
|
||||
}
|
||||
@@ -427,7 +434,7 @@ Future<void> showMessageDialog(BuildContext context, String title, String messag
|
||||
|
||||
class DecimalTextInputFormatter extends TextInputFormatter {
|
||||
int maxLength;
|
||||
|
||||
|
||||
int decimalPlaces;
|
||||
|
||||
DecimalTextInputFormatter({required this.maxLength, required this.decimalPlaces});
|
||||
@@ -440,9 +447,9 @@ class DecimalTextInputFormatter extends TextInputFormatter {
|
||||
if (text != "") {
|
||||
RegExp regExp;
|
||||
if (decimalPlaces > 0) {
|
||||
regExp = RegExp(r'[0-9]+[,]{0,1}[0-9]{0,${' + decimalPlaces.toString() + '}');
|
||||
regExp = RegExp(r'[0-9]+[,]{0,1}[0-9]{0,${decimalPlaces}');
|
||||
} else {
|
||||
regExp = RegExp(r'[0-9]{0,' + maxLength.toString() +'}');
|
||||
regExp = RegExp(r'[0-9]{0,${maxLength}}');
|
||||
}
|
||||
filteredText = regExp.stringMatch(text);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user